X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2FTApplication.java;h=c2aa656e805ac4ea4eb0dd8766c2aaa2eacb7840;hb=91c2f66ef49c23fa1d6fa5ad263b5a1fd9c158cf;hp=9f15ccbc4f5d33b6b21291a151da2cd41c78a870;hpb=a7986f7b289a17ca812a2f0cf04e48071accd636;p=fanfix.git diff --git a/src/jexer/TApplication.java b/src/jexer/TApplication.java index 9f15ccb..c2aa656 100644 --- a/src/jexer/TApplication.java +++ b/src/jexer/TApplication.java @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (C) 2016 Kevin Lamonte + * Copyright (C) 2017 Kevin Lamonte * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -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());