From 813cd3400991db39e87af842913eeaddd52a70f3 Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Fri, 19 Aug 2022 10:37:57 -0400 Subject: [PATCH] CSR-108: allow for cases where there is no damage state saved --- src/store/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/store/index.js b/src/store/index.js index b8b5ffe16..359d9cb3b 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -997,7 +997,7 @@ export const actions = { savePartQuestionAnswers(context, partQuestionAnswersArray) { // if part question answers have changed, reset subsequent question answers const previousResultsArray = context.getters.damage.partQuestionAnswers; - const havePartQuestionAnswersChanged = previousResultsArray.length !== partQuestionAnswersArray.length || + const havePartQuestionAnswersChanged = previousResultsArray?.length !== partQuestionAnswersArray.length || !previousResultsArray.every((x, i) => x.result === partQuestionAnswersArray[i].result); if (havePartQuestionAnswersChanged) {