#54 fix crash
authorKevin Lamonte <kevin.lamonte@gmail.com>
Wed, 28 Aug 2019 00:54:31 +0000 (19:54 -0500)
committerKevin Lamonte <kevin.lamonte@gmail.com>
Wed, 28 Aug 2019 00:54:31 +0000 (19:54 -0500)
src/jexer/TProgressBar.java

index 6ed5ccf752dbb8553bf7308be4165c165f6a8b43..38f03373b7c8d5d08f323f0e56fa34bac1516048 100644 (file)
@@ -123,6 +123,12 @@ public class TProgressBar extends TWidget {
      */
     @Override
     public void draw() {
+
+        if (getWidth() <= 2) {
+            // Bail out, we are too narrow to draw anything.
+            return;
+        }
+
         CellAttributes completeColor = getTheme().getColor("tprogressbar.complete");
         CellAttributes incompleteColor = getTheme().getColor("tprogressbar.incomplete");