This is an automated email from the ASF dual-hosted git repository.
shuai pushed a commit to branch feat/1.4.2/ui
in repository https://gitbox.apache.org/repos/asf/incubator-answer.git
The following commit(s) were added to refs/heads/feat/1.4.2/ui by this push:
new 0569ea9e fix: length error
0569ea9e is described below
commit 0569ea9ea389df0d0361efa63d8060001fa36ef7
Author: shuai <[email protected]>
AuthorDate: Fri Nov 22 12:42:05 2024 +0800
fix: length error
---
ui/src/components/Editor/ToolBars/file.tsx | 2 +-
ui/src/pages/Admin/Write/index.tsx | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/ui/src/components/Editor/ToolBars/file.tsx
b/ui/src/components/Editor/ToolBars/file.tsx
index 869d1dc6..15238379 100644
--- a/ui/src/components/Editor/ToolBars/file.tsx
+++ b/ui/src/components/Editor/ToolBars/file.tsx
@@ -113,7 +113,7 @@ const Image = ({ editorInstance }) => {
});
};
- if (!authorized_attachment_extensions.length) {
+ if (!authorized_attachment_extensions?.length) {
return null;
}
diff --git a/ui/src/pages/Admin/Write/index.tsx
b/ui/src/pages/Admin/Write/index.tsx
index d82f5aa0..91e41493 100644
--- a/ui/src/pages/Admin/Write/index.tsx
+++ b/ui/src/pages/Admin/Write/index.tsx
@@ -140,13 +140,13 @@ const Index: FC = () => {
max_attachment_size: Number(formData.max_attachment_size.value),
max_image_megapixel: Number(formData.max_image_megapixel.value),
authorized_image_extensions:
- formData.authorized_image_extensions.value.length > 0
+ formData.authorized_image_extensions.value?.length > 0
? formData.authorized_image_extensions.value
.split(',')
?.map((item) => item.trim().toLowerCase())
: [],
authorized_attachment_extensions:
- formData.authorized_attachment_extensions.value.length > 0
+ formData.authorized_attachment_extensions.value?.length > 0
? formData.authorized_attachment_extensions.value
.split(',')
?.map((item) => item.trim().toLowerCase())