[gedit] Catch case where start or end is not an iter for drawing snippet placeholder



commit 96632ce7bfe35452f00efc9f67489c6d8c1fc357
Author: Jesse van den Kieboom <jessevdk gnome org>
Date:   Wed Apr 7 19:54:33 2010 +0200

    Catch case where start or end is not an iter for drawing snippet placeholder

 plugins/snippets/snippets/Document.py |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/plugins/snippets/snippets/Document.py b/plugins/snippets/snippets/Document.py
index 414486d..e15f5a8 100644
--- a/plugins/snippets/snippets/Document.py
+++ b/plugins/snippets/snippets/Document.py
@@ -969,6 +969,9 @@ class Document:
                 start = placeholder.begin_iter()
                 end = placeholder.end_iter()
 
+                if not start or not end:
+                        return False
+
                 # Test if start is before bottom, and end is after top
                 start_rect = self.iter_coords(start)
                 end_rect = self.iter_coords(end)



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