fix: add null check for oldNode in GameEditorChangePropagator#2851
Conversation
- Added a null check for `oldNode` before invoking `visitor.Visit(oldNode)`. - This change prevents potential null reference exceptions during execution.
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a potential null reference exception in the GameEditorChangePropagator by adding a null check before calling visitor.Visit(oldNode). The fix addresses a bug introduced in the "User-defined assets support" feature that could cause crashes during game editor operations.
- Added null check for
oldNodeparameter before visitor invocation - Prevents null reference exceptions in the change propagation logic
Comments suppressed due to low confidence (1)
|
Looks good, thanks for the detailed description! |
|
That part was authored by xen afair so I'm not 100% certain what this change entails, do either of you know why If it is safe, shouldn't line 195 to 203 be included inside the if as well ? |
|
In Line 193 the oldNode is returned by the var oldNode = Editor.NodeContainer.GetNode(e.OldValue);Maybe you are right, and it is safer when the complete code is inside the if statement. |
PR Details
Added a null check for
oldNodebefore invokingvisitor.Visit(oldNode).This change prevents potential null reference exceptions during execution.
Related Issue
Closes #2850
Types of changes
Checklist