Skip to content

Guard REST results against malformed responses - #422

Merged
isc-klu merged 1 commit into
intersystems:masterfrom
isc-klu:fix-definition-undefined-result
Sep 10, 2026
Merged

isc-klu merged 1 commit into
intersystems:masterfrom
isc-klu:fix-definition-undefined-result

Conversation

@isc-klu

@isc-klu isc-klu commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator

Fixes #421

Root cause: Three REST call sites in definition.ts (/action/getmacrolocation and two /action/index) dereference respdata.data.result.content after only checking respdata !== undefined.

Solution: Guard all three with ?. / Array.isArray(...), matching the pattern every other REST site in the file already uses.

Fixes intersystems#421. Three sites in definition.ts dereferenced
respdata.data.result.content after only checking respdata !== undefined;
4xx bodies passed through by makeRESTRequest have no result, so this
threw. Guard them the same way the rest of the file already does.
@isc-klu isc-klu changed the title Guard Go to Definition REST results against error responses Guard REST results against malformed responses Sep 10, 2026
@isc-klu
isc-klu marked this pull request as ready for review September 10, 2026 15:21

@isc-bsaviano isc-bsaviano left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

@isc-klu
isc-klu merged commit 61987d4 into intersystems:master Sep 10, 2026
11 checks passed
@isc-klu
isc-klu deleted the fix-definition-undefined-result branch September 10, 2026 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Go to Definition fails with "Cannot read properties of undefined (reading 'content')"

2 participants