Skip to content

Commit d3a64f0

Browse files
author
Henrik
authored
fix options check
make sure to check if options exists before checking answer
1 parent 93bad19 commit d3a64f0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/models/QuestionModel.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ export default class QuestionModel {
134134

135135
// Check if we have an answer already (when we have a pre-filled form)
136136
// and set the answered property accordingly
137-
if (!this.required && typeof options.answer !== 'undefined') {
137+
if (!this.required && options && typeof options.answer !== 'undefined') {
138138
this.answered = true
139139
} else if (this.answer && (!this.multiple || this.answer.length)) {
140140
this.answered = true

0 commit comments

Comments
 (0)