From d49a676fd2bdd860e05fc65b8cd4833bb0ad8e51 Mon Sep 17 00:00:00 2001 From: Kevin Lamonte Date: Tue, 27 Aug 2019 19:54:31 -0500 Subject: [PATCH] #54 fix crash --- src/jexer/TProgressBar.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/jexer/TProgressBar.java b/src/jexer/TProgressBar.java index 6ed5ccf..38f0337 100644 --- a/src/jexer/TProgressBar.java +++ b/src/jexer/TProgressBar.java @@ -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"); -- 2.27.0