From e155c0114fb4b406892a6ec5c0e93cbc17f74754 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BE=9D=E7=91=AA=E8=B2=93?= Date: Mon, 9 Mar 2026 21:45:02 +0800 Subject: [PATCH] Add explicit return values in store catch blocks to prevent undefined crashes Co-Authored-By: Claude Opus 4.6 --- src/stores/allMapData.ts | 2 ++ src/stores/compare.ts | 1 + src/stores/conformance.ts | 2 ++ 3 files changed, 5 insertions(+) diff --git a/src/stores/allMapData.ts b/src/stores/allMapData.ts index 7d8cc55..b48f531 100644 --- a/src/stores/allMapData.ts +++ b/src/stores/allMapData.ts @@ -234,6 +234,7 @@ export const useAllMapDataStore = defineStore("allMapDataStore", { return; } apiError(error, "Failed to load the Trace Detail."); + return []; } }, /** @@ -278,6 +279,7 @@ export const useAllMapDataStore = defineStore("allMapDataStore", { return; } apiError(error, "Failed to load the Base Trace Detail."); + return []; } }, /** diff --git a/src/stores/compare.ts b/src/stores/compare.ts index 4acc59f..c19f339 100644 --- a/src/stores/compare.ts +++ b/src/stores/compare.ts @@ -64,6 +64,7 @@ export const useCompareStore = defineStore("compareStore", { return response.data.stats; } catch (error) { apiError(error, "Failed to load the Compare's States."); + return null; } }, /** diff --git a/src/stores/conformance.ts b/src/stores/conformance.ts index c0fbfce..5b16f7c 100644 --- a/src/stores/conformance.ts +++ b/src/stores/conformance.ts @@ -353,6 +353,7 @@ export const useConformanceStore = defineStore("conformanceStore", { error, "Failed to Get the detail of a temporary log conformance issue.", ); + return null; } }, /** @@ -393,6 +394,7 @@ export const useConformanceStore = defineStore("conformanceStore", { error, "Failed to Get the detail of a temporary log conformance loop.", ); + return null; } }, /**