[conduit] Protect a crast at startup



commit 363a321bacbc9a70c14d59eeafe4670f7d53aca9
Author: John Stowers <john stowers gmail com>
Date:   Mon Jan 11 22:14:25 2010 +0100

    Protect a crast at startup
    
    	* Should fix lunchpad 506110

 conduit/gtkui/Tree.py |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/conduit/gtkui/Tree.py b/conduit/gtkui/Tree.py
index e2bca4e..f0c072f 100644
--- a/conduit/gtkui/Tree.py
+++ b/conduit/gtkui/Tree.py
@@ -202,7 +202,14 @@ class DataProviderTreeModel(gtk.GenericTreeModel):
                 return None
             if debug:
                 print "on_get_iter: path = %s cat = %s" % (path, self.cats[path[0]])
-            return self.cats[path[0]]
+            try:
+                return self.cats[path[0]]
+            except IndexError:
+                #I cannot reproducibly hit this code path. This bug just seems to occur
+                #on Ubuntu Lucid
+                #https://bugs.launchpad.net/bugs/506110
+                log.critical("Strange bug, cannot get iter...")
+                return None
         else:
             try:
                 if debug:



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