Skip to content

Commit c8ab4ad

Browse files
committed
DefaultWidgetModel: check for null choicesList
Let's fail fast and return null when item.getChoices() returns null.
1 parent 46ca0d0 commit c8ab4ad

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/main/java/org/scijava/widget/DefaultWidgetModel.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ public Number getStepSize() {
221221
@Override
222222
public String[] getChoices() {
223223
final List<?> choicesList = item.getChoices();
224+
if (choicesList == null) return null;
224225
final String[] choices = new String[choicesList.size()];
225226
for (int i = 0; i < choices.length; i++) {
226227
choices[i] = objectService.getName(choicesList.get(i));

0 commit comments

Comments
 (0)