[gnome-music/gnome-3-14] widgets: Fix IndexError when a user cancels new playlist dialog



commit cd48994d40444a98c7c434686d4ada6aa1d2961a
Author: Sagar Ghuge <ghugesss gmail com>
Date:   Fri Jan 2 15:37:27 2015 +0530

    widgets: Fix IndexError when a user cancels new playlist dialog
    
    https://bugzilla.gnome.org/show_bug.cgi?id=742123

 gnomemusic/widgets.py |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/gnomemusic/widgets.py b/gnomemusic/widgets.py
index 664afa4..0312ce0 100644
--- a/gnomemusic/widgets.py
+++ b/gnomemusic/widgets.py
@@ -734,7 +734,8 @@ class PlaylistDialog():
     @log
     def _on_playlist_created(self, playlists, item):
         new_iter = self._add_item_to_model(item)
-        self.view.set_cursor(self.model.get_path(new_iter),
-                             self.view.get_columns()[0], False)
-        self.view.row_activated(self.model.get_path(new_iter),
-                                self.view.get_columns()[0])
+        if self.view.get_columns():
+            self.view.set_cursor(self.model.get_path(new_iter),
+                                 self.view.get_columns()[0], False)
+            self.view.row_activated(self.model.get_path(new_iter),
+                                    self.view.get_columns()[0])


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]