diff --git a/src/layouts/vehicle-parts/vehicle-parts.vue b/src/layouts/vehicle-parts/vehicle-parts.vue index 290910217..27a92ddf4 100644 --- a/src/layouts/vehicle-parts/vehicle-parts.vue +++ b/src/layouts/vehicle-parts/vehicle-parts.vue @@ -159,7 +159,7 @@ export default { Object.keys(store.getters.pageData(fmgPageValues.VEHICLE_PARTS)).length !== 0; }, backButtonAction() { - const hasPartQuestions = this.hasPartQuestions(this.$store.getters.pageData(fmgPageValues.PART_QUESTIONS).partsOrQuestions); + const hasPartQuestions = this.hasPartQuestions(this.$store.getters.pageData(fmgPageValues.PART_QUESTIONS)?.partsOrQuestions); const backNavigationScenario = hasPartQuestions ? this.navigationScenarios.CLICKED_BACK_WITH_PART_QUESTION_ANSWERS : this.navigationScenarios.CLICKED_BACK_WITHOUT_PART_QUESTION_ANSWERS; this.$router.navigate( diff --git a/src/mixins/vehicle-questions-mixin.js b/src/mixins/vehicle-questions-mixin.js index 7a86066a8..4331529d4 100644 --- a/src/mixins/vehicle-questions-mixin.js +++ b/src/mixins/vehicle-questions-mixin.js @@ -2,10 +2,10 @@ export default { methods: { hasPartQuestions(partsOrQuestions) { - return partsOrQuestions.some(pq => pq.partQuestions?.length > 0); + return partsOrQuestions?.some(pq => pq.partQuestions?.length > 0); }, hasGlassLocationWithMultipleParts(partsOrQuestions) { - return partsOrQuestions.some(pq => pq.parts?.length > 1); + return partsOrQuestions?.some(pq => pq.parts?.length > 1); }, hasChildPartQuestions(partsOrQuestions) { return partsOrQuestions.some(pq => {