From 20e7acd5d2421b53e5b2849e784e32fe93d4cac8 Mon Sep 17 00:00:00 2001 From: KaboPC Date: Fri, 30 Nov 2012 20:03:36 -0500 Subject: [PATCH] Fix index out of bounds in get_text_and_insertion_data Check size of textL before accessing.(cherry picked from commit db25b4131f3c042b3edc824550a2724433ea5b76) --- albow/fields.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/albow/fields.py b/albow/fields.py index 9dc1816..d8ab053 100644 --- a/albow/fields.py +++ b/albow/fields.py @@ -677,7 +677,8 @@ class TextEditorWrapped(Widget): i = self.insertion_step il = self.insertion_line if i is not None: - i = max(0, min(i, len(self.textL[il]))) + if il < len(textL): + i = max(0, min(i, len(self.textL[il]))) return text, i, il def move_insertion_point(self, d):