From 1f3a198a6d29ee8f711e76f7d17ae6a548b33d5a 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:22:31 +0800 Subject: [PATCH] Add null guard before spreading error.response.data.detail in uploadLog Co-Authored-By: Claude Opus 4.6 --- src/stores/files.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/stores/files.ts b/src/stores/files.ts index 009e841..bcde0f3 100644 --- a/src/stores/files.ts +++ b/src/stores/files.ts @@ -217,7 +217,8 @@ export const useFilesStore = defineStore("filesStore", { this.$router.push({ name: "Files" }); } catch (error) { if (error.response?.status === 422) { - const detail = [...error.response.data.detail]; + const raw = error.response.data?.detail; + const detail = Array.isArray(raw) ? [...raw] : []; uploadFailedSecond(detail); } else {