Add null guard before spreading error.response.data.detail in uploadLog

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-09 21:22:31 +08:00
parent 533b78a37f
commit 1f3a198a6d

View File

@@ -217,7 +217,8 @@ export const useFilesStore = defineStore("filesStore", {
this.$router.push({ name: "Files" }); this.$router.push({ name: "Files" });
} catch (error) { } catch (error) {
if (error.response?.status === 422) { 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); uploadFailedSecond(detail);
} else { } else {