Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix lspFrame.source NPE on stackTrace request#616

Merged
chagong merged 2 commits intomicrosoft:main from
mfussenegger:frame-source-npe
Dec 9, 2025
Merged

Fix lspFrame.source NPE on stackTrace request #616
chagong merged 2 commits intomicrosoft:main from
mfussenegger:frame-source-npe

Conversation

@mfussenegger
Copy link
Contributor

@mfussenegger mfussenegger commented Dec 4, 2025
edited
Loading

Follow up to:

With the change to set the line number to 0 the jdiLineNumber !=
lspFrame.line comparison can evaluate to true:

dap> lspFrame
Types$StackFrame@78
 column: 1
 id: 6
 line: 0
 name: "0x000000002f0bc000.invokeVirtual(Object,Object)"
 presentationHint: "subtle"
 source: null
dap> jdiLineNumber
-1

source being null caused an NPE

Fixes #612

Follow up to:
- microsoft#614
- microsoft#609
With the change to set the line number to 0 the jdiLineNumber !=
lspFrame.line comparison can evaluate to true:
 dap> lspFrame
 Types$StackFrame@78
 column: 1
 id: 6
 line: 0
 name: "0x000000002f0bc000.invokeVirtual(Object,Object)"
 presentationHint: "subtle"
 source: null
 dap> jdiLineNumber
 -1
`source` being null caused an NPE
Comment on lines 116 to 117
int jdiLineNumber = AdapterUtils.convertLineNumber(jdiFrame.lineNumber, context.isDebuggerLinesStartAt1(), context.isClientLinesStartAt1());
if (jdiLineNumber != lspFrame.line) {
if (jdiLineNumber != lspFrame.line && lspFrame.source != null) {
Copy link
Contributor Author

@mfussenegger mfussenegger Dec 4, 2025

Choose a reason for hiding this comment

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

Could also change convertLineNumber to return 0 as is?
No idea what other implications that might have.

Copy link
Contributor

@chagong chagong Dec 8, 2025

Choose a reason for hiding this comment

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

This PR should be safe to merge, but I will test a little bit for different cases.

@chagong chagong merged commit 81339de into microsoft:main Dec 9, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@chagong chagong chagong approved these changes

@testforstephen testforstephen testforstephen approved these changes

@jdneo jdneo Awaiting requested review from jdneo jdneo is a code owner

@wenytang-ms wenytang-ms Awaiting requested review from wenytang-ms wenytang-ms is a code owner

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Cannot read field "path" because "lspFrame.source" is null

AltStyle によって変換されたページ (->オリジナル) /