diff --git a/src/runtime/helpers.ts b/src/runtime/helpers.ts index 5cd4f8fa..127356d9 100644 --- a/src/runtime/helpers.ts +++ b/src/runtime/helpers.ts @@ -73,10 +73,10 @@ export const jsonPointerGet = ( 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