Skip to content

DAP: Set Value on an Evaluate result throws a NullPointerException #2117

Closed

Description

@lagergren

What happens

With a debug adapter that supports setVariable, Set Value (F2) is enabled on an Evaluate result, and on the top value of an expression's value popup. Pressing Enter throws:

java.lang.NullPointerException: Cannot invoke "java.lang.Integer.intValue()" because the return value of "com.redhat.devtools.lsp4ij.dap.client.variables.DAPValue.getParentVariablesReference()" is null
    at com.redhat.devtools.lsp4ij.dap.client.variables.DAPValueModifier.setValue(DAPValueModifier.java:34)
    at com.intellij.xdebugger.impl.ui.DebuggerUIUtil.setTreeNodeValue(DebuggerUIUtil.java:472)
  • Nothing is sent to the adapter, and the value keeps showing "Modifying value…".
  • The exception also skips super.doOKAction() in SetValueInplaceEditor.doOKAction, which hides the editor, so the editor stays open.

Reproduced on IntelliJ IDEA Community 2024.2 and 2025.3, with a test that drives Set Value through DebuggerUIUtil.setTreeNodeValue, as pressing Enter does.

Steps

  1. Debug with an adapter that has supportsSetVariable, for example debugpy or vscode-js-debug.
  2. Stop at a breakpoint.
  3. Evaluate x in Evaluate Expression.
  4. Select the result, press F2, type 42 and press Enter.

Expected

Set Value isn't offered for a value that setVariable can't address, and it never throws. Set Value on a variable in the Variables view keeps working, as it does today.

Cause

On main (35eb012):

  • DAPDebuggerEvaluator.evaluate creates the result with no parent reference: new DAPValue(stackFrame, variable, null) (DAPDebuggerEvaluator.java:131). Watches come through here too, but IntelliJ never offers Set Value on a watch (XSetValueAction.update hides it for a watch node).
  • DAPValue.getModifier returns a DAPValueModifier when the adapter supports setVariable and the value isn't read-only. It doesn't look at the parent reference (DAPValue.java:99-105).
  • DAPValueModifier.setValue passes value.getParentVariablesReference(), an Integer, to DAPClient.setVariable(String, int, String) (DAPValueModifier.java:34, DAPClient.java:1473-1474). Unboxing null throws.

Suggested fix

Related

#2109

Activity

  1. added
    bug
    dap
    on Nov 22, 2026
  2. changed the title [-]DAP: Set Value on a watch or an Evaluate result throws a NullPointerException[/-] [+]DAP: Set Value on an Evaluate result throws a NullPointerException[/+] on Nov 22, 2026
  3. added a commit that references this issue on Nov 22, 2026
    ab2a8ea
  4. added this to the 0.30.2 milestone on Nov 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugdap

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions