From a6fdc996d2a20e3929322b0b4d9275b9b9b43c66 Mon Sep 17 00:00:00 2001 From: Autumn Lamonte Date: Thu, 1 Feb 2024 11:55:48 -0600 Subject: [PATCH] #115 check for null in TList.setSelectedIndex() --- src/jexer/TList.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/jexer/TList.java b/src/jexer/TList.java index e49970b..222824a 100644 --- a/src/jexer/TList.java +++ b/src/jexer/TList.java @@ -457,7 +457,7 @@ public class TList extends TScrollableWidget { * @param index -1 to unselect, otherwise the index into the list */ public final void setSelectedIndex(final int index) { - if ((strings.size() == 0) || (index < 0)) { + if ((strings == null) || (strings.size() == 0) || (index < 0)) { toTop(); selectedString = -1; return;