[hamster-applet] don't complain if there is no selection



commit 1addd02d97bf818f4c5811eb249dc459e0444def
Author: Toms Bauģis <toms baugis gmail com>
Date:   Sat May 15 11:14:44 2010 +0100

    don't complain if there is no selection

 src/hamster/widgets/facttree.py |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/src/hamster/widgets/facttree.py b/src/hamster/widgets/facttree.py
index d7d2927..dead7f0 100644
--- a/src/hamster/widgets/facttree.py
+++ b/src/hamster/widgets/facttree.py
@@ -192,9 +192,12 @@ class FactTree(gtk.TreeView):
 
 
     def store_selection(self):
+        self.stored_selection = None
         selection = self.get_selection()
+        if not selection:
+            return
+
         model, iter = selection.get_selected()
-        self.stored_selection = None
         if iter:
             path = model.get_path(iter)[0]
             prev, cur, next = path - 1, path, path + 1



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