From fca6977ad167421fbf4d07e2ad03ccb4c01734fb Mon Sep 17 00:00:00 2001 From: Chareice Date: Wed, 9 Feb 2022 09:56:52 +0800 Subject: [PATCH] fix: getListenServerHooks --- packages/plugin-ui-schema-storage/src/model.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/plugin-ui-schema-storage/src/model.ts b/packages/plugin-ui-schema-storage/src/model.ts index d9275893d..994082cd4 100644 --- a/packages/plugin-ui-schema-storage/src/model.ts +++ b/packages/plugin-ui-schema-storage/src/model.ts @@ -3,7 +3,7 @@ import { HookType } from './server-hooks'; class UiSchemaModel extends MagicAttributeModel { getListenServerHooks(type: HookType) { - const hooks = this.get('x-server-hooks'); + const hooks = this.get('x-server-hooks') || {}; return hooks[type] || []; } }