diff --git a/packages/editor/src/components/toolbar/ToolbarValueModelBuilder.ts b/packages/editor/src/components/toolbar/ToolbarValueModelBuilder.ts index 1d0a2107..6cbb1dcc 100644 --- a/packages/editor/src/components/toolbar/ToolbarValueModelBuilder.ts +++ b/packages/editor/src/components/toolbar/ToolbarValueModelBuilder.ts @@ -249,7 +249,7 @@ export class NodePropertyValueModelBuilder { getFontStyleModel(): NodePropertyValueModel { if (!this.fontStyleModel) this.fontStyleModel = { - getValue: () => this.selectedTopic().getFontStyle(), + getValue: () => this.selectedTopic()?.getFontStyle(), switchValue: () => designer.changeFontStyle(), }; return this.fontStyleModel;