Skip to content

Commit

Permalink
Stop survey editor from crashing on certain surveys
Browse files Browse the repository at this point in the history
Not sure why questionType sometimes becomes undefined
  • Loading branch information
ivarnakken committed Oct 14, 2023
1 parent 11da240 commit f7e6ede
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/routes/surveys/components/SurveyEditor/Question.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const Question = ({
}}
/>
</div>
{questionData.questionType.value === QuestionTypes('text') ? (
{questionData.questionType?.value === QuestionTypes('text') ? (
<TextArea
className={styles.freeText}
placeholder="Fritekst - sånn her vil den se ut :smile:"
Expand All @@ -77,7 +77,7 @@ const Question = ({
) : (
<FieldArray
name={`${question}.options`}
questionType={questionData.questionType.value}
questionType={questionData.questionType?.value}
component={renderOptions}
/>
)}
Expand Down

0 comments on commit f7e6ede

Please sign in to comment.