Skip to content

Commit 2a387ad

Browse files
committed
undefined inedex fix
1 parent 7e10b2c commit 2a387ad

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/jsxpression/src/schema.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,11 @@ export function getPropertyAtPath(schema: Schema, path: string[]): PropertySchem
163163
return undefined;
164164
}
165165

166-
let current: PropertySchema | undefined = schema.data[path[0]];
166+
let current: PropertySchema | undefined = path[0] !== undefined ? schema.data[path[0]] : undefined;
167167

168168
for (let i = 1; i < path.length && current; i++) {
169169
if (current.type === "object" && current.shape) {
170-
current = current.shape[path[i]];
170+
current = current.shape[path[i]!];
171171
} else {
172172
return undefined;
173173
}

0 commit comments

Comments
 (0)