rind: Don't change playlist selection if no rows are selected

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This commit is contained in:
Anna Schumaker 2019-03-29 15:10:01 -04:00
parent d89ffd3910
commit 277edca3e5
2 changed files with 5 additions and 2 deletions

View File

@ -122,8 +122,9 @@ class ManagerModel(GObject.GObject, Gtk.TreeModel):
def on_selection_changed(self, selection):
(model, rows) = selection.get_selected_rows()
plist = model.iter_playlist(model.get_iter(rows[0]))
playlist.PlistModel.set_playlist(plist)
if len(rows) > 0:
plist = model.iter_playlist(model.get_iter(rows[0]))
playlist.PlistModel.set_playlist(plist)
MgrModel = ManagerModel()

View File

@ -153,3 +153,5 @@ class TestManager(unittest.TestCase):
selection.select_path(path)
self.assertTrue(selection.path_is_selected(path))
self.assertEqual(playlist.PlistModel.playlist, plist)
selection.unselect_all()