Skip to content

Commit 2ba62dc

Browse files
laske185tebjan
authored andcommitted
fix: add null check for oldNode in GameEditor
- Added a null check for `oldNode` before invoking `visitor.Visit(oldNode)`. - This change prevents potential null reference exceptions during execution.
1 parent 27f87bf commit 2ba62dc

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

sources/editor/Stride.Assets.Presentation/AssetEditors/GameEditor/ViewModels/GameEditorChangePropagator.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,11 @@ await Editor.Controller.InvokeTask(async () =>
201201
if (gameSideNode != null)
202202
removedNodes.Add(gameSideNode);
203203
};
204-
visitor.Visit(oldNode);
204+
205+
if (oldNode != null)
206+
{
207+
visitor.Visit(oldNode);
208+
}
205209

206210
await Editor.Controller.InvokeTask(async () =>
207211
{

0 commit comments

Comments
 (0)