From 44da4246b13e81ca2b4b745381aceb1dc4e99b7e Mon Sep 17 00:00:00 2001 From: Mark Bouslog Date: Tue, 9 Jan 2024 11:29:30 -0600 Subject: [PATCH] Add undefined check for options (#7006) --- app/classifier/tasks/dropdown/dropdown-dialog.cjsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/classifier/tasks/dropdown/dropdown-dialog.cjsx b/app/classifier/tasks/dropdown/dropdown-dialog.cjsx index 86556a27b6..cfa64a14cd 100644 --- a/app/classifier/tasks/dropdown/dropdown-dialog.cjsx +++ b/app/classifier/tasks/dropdown/dropdown-dialog.cjsx @@ -154,7 +154,7 @@ DropdownDialog = createReactClass return window.alert('Dropdowns must have a Title.') # for FEMLab we want to enforce a min and max number of options - numOptions = @state.editSelect.options['*'].length + numOptions = @state.editSelect.options['*']?.length if @props.pfeLab is false and numOptions < OPTIONS_MIN return window.alert('Dropdowns must have at least 4 options.') else if @props.pfeLab is false and numOptions > OPTIONS_MAX