From 87f1b951907f0d2547beda14d677c410bcba066e Mon Sep 17 00:00:00 2001 From: Autumn Lamonte Date: Wed, 2 Feb 2022 17:09:49 -0600 Subject: [PATCH] fix npe --- src/jexer/TTerminalWidget.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/jexer/TTerminalWidget.java b/src/jexer/TTerminalWidget.java index 34307ec..f70178a 100644 --- a/src/jexer/TTerminalWidget.java +++ b/src/jexer/TTerminalWidget.java @@ -1492,7 +1492,10 @@ public class TTerminalWidget extends TScrollableWidget synchronized (dirtyQueue) { dirtyQueue.add(display); } - getApplication().doRepaint(); + TApplication app = getApplication(); + if (app != null) { + app.doRepaint(); + } } /** @@ -1502,8 +1505,11 @@ public class TTerminalWidget extends TScrollableWidget * may be on a different location. */ public void displayChanged(final boolean cursorOnly) { + TApplication app = getApplication(); if (cursorOnly) { - getApplication().doRepaint(); + if (app != null) { + app.doRepaint(); + } return; } @@ -1516,7 +1522,9 @@ public class TTerminalWidget extends TScrollableWidget if (readDisplay) { readEmulatorDisplay(); } - getApplication().doRepaint(); + if (app != null) { + app.doRepaint(); + } } /**