Skip to content

Commit fb5d2b9

Browse files
committed
fix: prevent error when $route is undefined by using optional chaining
Signed-off-by: silver <[email protected]>
1 parent b614d53 commit fb5d2b9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/components/board/Board.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ export default {
179179
await this.$store.dispatch('loadBoardById', this.id)
180180
await this.$store.dispatch('loadStacks', this.id)
181181
182-
const routeCardId = parseInt(this.$route.params.cardId)
182+
const routeCardId = this.$route?.params?.cardId ? parseInt(this.$route.params.cardId) : null
183183
// If an archived card is requested, and we cannot find it in the current we load the archived stacks instead
184184
if (routeCardId && !this.$store.getters.cardById(routeCardId)) {
185185
await this.$store.dispatch('loadArchivedStacks', this.id)

0 commit comments

Comments
 (0)