From 205bd4ec9473b8e31609d47b59ada7e6f5d70952 Mon Sep 17 00:00:00 2001 From: arlo Date: Mon, 11 Nov 2024 18:10:27 +0800 Subject: [PATCH] fix(kit): add null-safety check on process instance props, close #688 --- packages/devtools-kit/src/core/component/state/process.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/devtools-kit/src/core/component/state/process.ts b/packages/devtools-kit/src/core/component/state/process.ts index 07782ad7b..4b9610057 100644 --- a/packages/devtools-kit/src/core/component/state/process.ts +++ b/packages/devtools-kit/src/core/component/state/process.ts @@ -63,7 +63,7 @@ function processProps(instance: VueAppInstance) { const props: InspectorState[] = [] const propDefinitions = instance?.type?.props - for (const key in instance.props) { + for (const key in instance?.props) { const propDefinition = propDefinitions ? propDefinitions[key] : null const camelizeKey = camelize(key) props.push({ @@ -96,7 +96,7 @@ function processProps(instance: VueAppInstance) { */ function processState(instance: VueAppInstance) { const type = instance.type - const props = type.props + const props = type?.props const getters = type.vuex && type.vuex.getters