diff --git a/albow/fields.py b/albow/fields.py index cf8691e..348ffb3 100644 --- a/albow/fields.py +++ b/albow/fields.py @@ -678,7 +678,7 @@ class TextEditorWrapped(Widget): il = self.insertion_line if il is not None: il = max(0, min(il, (len(self.textL)-1))) - if i is not None and il is not None: + if i is not None and il is not None and len(self.textL) > 0: i = max(0, min(i, len(self.textL[il])-1)) return text, i, il