[meld/Python3: 3/54] tree: Don't choke if we get a bad tree path



commit 64551b1faa31ac751038375668ecf3d07d8d22ef
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Sat Jan 4 07:27:08 2014 +1000

    tree: Don't choke if we get a bad tree path

 meld/tree.py |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/meld/tree.py b/meld/tree.py
index 6994e9c..06eb590 100644
--- a/meld/tree.py
+++ b/meld/tree.py
@@ -206,7 +206,11 @@ class DiffTreeStore(Gtk.TreeStore):
 
     def _find_next_prev_diff(self, start_path):
         prev_path, next_path = None, None
-        start_iter = self.get_iter(start_path)
+        try:
+            start_iter = self.get_iter(start_path)
+        except ValueError:
+            # Invalid tree path
+            return None, None
 
         for it in self.inorder_search_up(start_iter):
             state = self.get_state(it, 0)


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