#115 check for null in TList.setSelectedIndex()

This commit is contained in:
Autumn Lamonte 2024-02-01 11:55:48 -06:00
parent 961fa67fc0
commit a6fdc996d2

View file

@ -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;