fix(core): options might undefined (#3999)

Co-authored-by: zuozijian3720 <zuozijian1994@gmail.com>
This commit is contained in:
Alex Yang 2023-08-29 05:19:21 -05:00 committed by GitHub
parent 41f2420533
commit 06cec822f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 3 deletions

View File

@ -146,9 +146,12 @@ export const BlockSuitePageList = ({
const tagOptionMap = useMemo(
() =>
Object.fromEntries(
blockSuiteWorkspace.meta.properties.tags.options.map(v => [v.id, v])
(blockSuiteWorkspace.meta.properties.tags?.options ?? []).map(v => [
v.id,
v,
])
),
[blockSuiteWorkspace.meta.properties.tags.options]
[blockSuiteWorkspace.meta.properties.tags?.options]
);
const list = useMemo(
() =>

View File

@ -41,7 +41,7 @@ export const variableDefineMap = {
icon: <FavoriteIcon />,
},
Tags: {
type: meta => tArray(tTag.create({ tags: meta.tags.options })),
type: meta => tArray(tTag.create({ tags: meta.tags?.options ?? [] })),
icon: <TagsIcon />,
},
// Imported: {