Skip to content

Commit 26cc345

Browse files
committed
ts5 fix getNodeAtPosition crash
1 parent 3517dbb commit 26cc345

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/apiCommands.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export default () => {
3333
// and so on
3434
operationsCache.set(type, { key: operationKey, data })
3535
if (type === 'getNodePath') {
36-
operationsCache.set('getNodeAtPosition', { key: operationKey, data: data.then((path: any) => path[path.length - 1]) })
36+
operationsCache.set('getNodeAtPosition', { key: operationKey, data: data.then((path: any) => path?.[path.length - 1]) })
3737
}
3838

3939
return data

0 commit comments

Comments
 (0)