Skip to content

Commit

Permalink
fix: type issue - forgotten changes from daniel
Browse files Browse the repository at this point in the history
  • Loading branch information
Valentin Hutter authored and Valentin Hutter committed Dec 5, 2023
1 parent 2044dce commit 4613e42
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/runtime/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ export const jsonPointerGet = <TResult, T extends object = object>(

for (let i = 0; i < refTokens.length; ++i) {
const tok = refTokens[i]
if (!(typeof result === 'object' && tok in result)) {
if (!(typeof result === 'object' && result && tok in result)) {
throw new Error('Invalid reference token: ' + tok)
}
result = result[tok]
result = (result as any)[tok]
}

return result
Expand Down

0 comments on commit 4613e42

Please sign in to comment.