fix: check validity of node instance before accessing it.

This commit is contained in:
redglow
2026-07-17 15:44:49 +02:00
parent c2676ac842
commit 7c16dddbd0
+3
View File
@@ -77,6 +77,9 @@ public partial class Plugin : EditorPlugin
// mark debounce as completed
_sceneTreeTimer = null;
// check that the instance is still valid after debouncing (could have been disposed)
if (!IsInstanceValid(sceneRoot)) return;
var sceneNodes = sceneRoot.FindChildren("*").Where(node => node.Owner == sceneRoot).Append(sceneRoot).ToList();
GD.Print($"Updating injection for root {sceneRoot.Name}");