X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2FTApplication.java;h=c2aa656e805ac4ea4eb0dd8766c2aaa2eacb7840;hb=c3a80df6a4236824f1b2e15dab37f7c700f02527;hp=08ad1de436ec3d48504a9e5465869e98335ac7c0;hpb=a2018e9964f6c58742cd1e6dd0a0c63e244a89d6;p=fanfix.git diff --git a/src/jexer/TApplication.java b/src/jexer/TApplication.java index 08ad1de..c2aa656 100644 --- a/src/jexer/TApplication.java +++ b/src/jexer/TApplication.java @@ -721,7 +721,10 @@ public class TApplication implements Runnable { // Draw each window in reverse Z order List sorted = new LinkedList(windows); Collections.sort(sorted); - TWindow topLevel = sorted.get(0); + TWindow topLevel = null; + if (sorted.size() > 0) { + topLevel = sorted.get(0); + } Collections.reverse(sorted); for (TWindow window: sorted) { window.drawChildren(); @@ -768,7 +771,10 @@ public class TApplication implements Runnable { } // Draw the status bar of the top-level window - TStatusBar statusBar = topLevel.getStatusBar(); + TStatusBar statusBar = null; + if (topLevel != null) { + statusBar = topLevel.getStatusBar(); + } if (statusBar != null) { getScreen().resetClipping(); statusBar.setWidth(getScreen().getWidth());