lanterna: update
[jvcard.git] / src / com / googlecode / lanterna / gui2 / InteractableLookupMap.java
index 36d285ee56eb7c004191875b0adaa95f29979ec8..a200a302f40f6f51fbdd7953f0a8e48086794387 100644 (file)
@@ -136,6 +136,10 @@ public class InteractableLookupMap {
             }
         }
         startPosition = interactable.toBasePane(startPosition);
+        if(startPosition == null) {
+            // The structure has changed, our interactable is no longer inside the base pane!
+            return null;
+        }
         Set<Interactable> disqualified = getDisqualifiedInteractables(startPosition, true);
         TerminalSize size = getSize();
         int maxShiftLeft = interactable.toBasePane(TerminalPosition.TOP_LEFT_CORNER).getColumn();
@@ -212,6 +216,10 @@ public class InteractableLookupMap {
             }
         }
         startPosition = interactable.toBasePane(startPosition);
+        if(startPosition == null) {
+            // The structure has changed, our interactable is no longer inside the base pane!
+            return null;
+        }
         Set<Interactable> disqualified = getDisqualifiedInteractables(startPosition, false);
         TerminalSize size = getSize();
         int maxShiftUp = interactable.toBasePane(TerminalPosition.TOP_LEFT_CORNER).getRow();