From 41f9a0bda96defdf6c84451cdeb6df3fe35a6b53 Mon Sep 17 00:00:00 2001 From: Lhcfl Date: Fri, 26 Apr 2024 10:34:12 +0800 Subject: [PATCH] fix: Unrecognized language causes errors --- packages/client/src/components/MkPostForm.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/client/src/components/MkPostForm.vue b/packages/client/src/components/MkPostForm.vue index 434d10afb9..244da153ec 100644 --- a/packages/client/src/components/MkPostForm.vue +++ b/packages/client/src/components/MkPostForm.vue @@ -801,13 +801,17 @@ function setLanguage() { actions.push(null); } - if (language.value != null) + if (language.value != null && langmap[language.value] != null) { actions.push({ text: langmap[language.value].nativeName, danger: false, active: true, action: () => {}, }); + } else { + // Unrecognized language, set to null + language.value = null; + } const langs = Object.keys(langmap);