[BUG] Incorrect use of "?." operator causes exceptions.

NodeCanvas Forums Support [BUG] Incorrect use of "?." operator causes exceptions.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #15221
    guyboots_thunderbro
    Participant

    The exception:

    The source:

    Node.cs#416, Task.cs#219, Task.cs#320,

    The problem:

    C#’s ?. operator doesn’t work with Unity Objects (UnityEngine.Object). So instead of backing off if MonoManager.current is null, this code is executed anyway, then triggers the UnityException above.

    Note:

    The list of problem areas isn’t exhaustive. Just what I noticed; I think a more thorough approach (EG “Find All”) is a good idea.

    #15224
    guyboots_thunderbro
    Participant

    Left this out of the original post, but: this only happens when Unity is unloading everything when exiting play mode, so it causes a flood of exceptions in the console that don’t mean anything but can hide other errors none-the-less.

    #15232
    Gavalakis
    Keymaster

    Hello again,

    I will change those to normal null checks and do some further testing.

    Thank you.

    Join us on Discord: https://discord.gg/97q2Rjh

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.