Skip to content

Placing a breakpoint in my Main class causes 'Null Object Reference' error #32

Open

Description

@twilson90

As soon as it hits any breakpoint it errors and quits.
No breakpoints = no error.
Other projects do not have this error... There must be something in my script that triggers this but it's very large and I've yet to find the cause.

Activity

  1. LviatYi commented on Sep 10, 2025

    @LviatYi

    Sorry for being late. I encountered a similar issue and have pinpointed the cause. I hope this helps.

    Please check if there's a getter like this in the class where your breakpoint is located:

    • If it is called when the breakpoint is reached, an error will occur.

    Even if the getter isn't actually called, or even if it's never called, an error will still occur.

    I believe there are two reasons for this issue:

    1. In VariablesPrinter:240, an attempt is made to log the values ​​of fields and properties after the breakpoint is entered. This means an implicit function call (the getter) occurs, and it's entirely possible that the function will fail.
    2. This line is clearly surrounded by a try_catch block, but in reality, a ThreadInfo.STATUS_STOPPED_BREAKPOINT event is reported before the error is caught. This event is then handled by Server.hx:560. The result is an ExceptionStop message sent to the debugger, before the catch.

    Finally, you encounter an error. If this is the case for you, you can wrap the getter in your business code with a try_catch block.

    I'm still investigating a fix for the debugger.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions