Skip to content

Commit

Permalink
fix(csm): handle Cannot read properties of undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
stipsan committed Jan 22, 2025
1 parent f657dee commit cb80d68
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/csm/applySourceDocuments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export function applySourceDocuments<Result = unknown>(
if (!resultSourceMap) return result

const resolveDocument = createSourceDocumentResolver(getCachedDocument, perspective)
const cachedDocuments = resultSourceMap.documents.map(resolveDocument)
const cachedDocuments = resultSourceMap.documents?.map?.(resolveDocument) || []

return walkMap(JSON.parse(JSON.stringify(result)), (value, path) => {
const resolveMappingResult = resolveMapping(path, resultSourceMap)
Expand Down

0 comments on commit cb80d68

Please sign in to comment.