From 441607b316612d5d56546c8bf6f60093e9e8bdc0 Mon Sep 17 00:00:00 2001 From: Hugo Posnic Date: Thu, 22 Aug 2019 00:58:09 +0200 Subject: [PATCH] songsview: Fix a crash in selection mode When clicking and dragging a row outside of the TreeView widget in selection mode a None path would be returned. This return value was unhandled and crashed Music. Handle the None value and return as it is not a valid row. --- gnomemusic/views/songsview.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gnomemusic/views/songsview.py b/gnomemusic/views/songsview.py index a940824ca..c56c4dc25 100644 --- a/gnomemusic/views/songsview.py +++ b/gnomemusic/views/songsview.py @@ -197,8 +197,11 @@ class SongsView(BaseView): # FIXME: In selection mode, star clicks might still trigger # activation. if self.props.selection_mode: - path, col, cell_x, cell_y = self._view.get_path_at_pos(x, y) - iter_ = self._view.props.model.get_iter(path) + path = self._view.get_path_at_pos(x, y) + if path is None: + return + + iter_ = self._view.props.model.get_iter(path[0]) new_fav_status = not self._model[iter_][1] self._model[iter_][1] = new_fav_status self._model[iter_][7].props.selected = new_fav_status -- GitLab