From 98927d1cbf1664cb7a5b903a2c04ab06cdd6fce3 Mon Sep 17 00:00:00 2001 From: tsukumi Date: Mon, 6 Jan 2025 15:24:59 +0900 Subject: [PATCH] =?UTF-8?q?Fix:=20=E7=B4=B0=E3=81=8B=E3=81=AA=E3=82=A8?= =?UTF-8?q?=E3=83=A9=E3=83=BC=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Dialog/DictionaryManageDialog.vue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/Dialog/DictionaryManageDialog.vue b/src/components/Dialog/DictionaryManageDialog.vue index 14ae5a95..94ad6ebb 100644 --- a/src/components/Dialog/DictionaryManageDialog.vue +++ b/src/components/Dialog/DictionaryManageDialog.vue @@ -542,7 +542,10 @@ const wordTypeLabels = { }; // 品詞フィールドから WordTypes を推定する関数 -const getWordTypeFromPartOfSpeech = (dictData: UserDictWord): WordTypes => { +const getWordTypeFromPartOfSpeech = (dictData: UserDictWord | undefined): WordTypes => { + // 基本ないが、もし dictData が undefined の場合は固有名詞として扱う + if (!dictData) return WordTypes.ProperNoun; + const { partOfSpeech, partOfSpeechDetail1, partOfSpeechDetail2, partOfSpeechDetail3 } = dictData; if (partOfSpeech === "名詞") { if (partOfSpeechDetail1 === "固有名詞") {