Fix potential incorrect null checks in FlaxEngine.Objects
The null-conditional operator checks for reference equality of the Object, but doesn't check the validity of the unmanaged pointer. This check is corrected in cases where the object was not immediately returned from the bindings layer and may have been destroyed earlier.
This commit is contained in:
@@ -375,7 +375,7 @@ namespace FlaxEditor.Tools.Foliage
|
||||
|
||||
private void OnModified()
|
||||
{
|
||||
Editor.Instance.Scene.MarkSceneEdited(_proxy.Foliage?.Scene);
|
||||
Editor.Instance.Scene.MarkSceneEdited(_proxy.Foliage != null ? _proxy.Foliage.Scene : null);
|
||||
}
|
||||
|
||||
private void OnSelectedFoliageChanged()
|
||||
|
||||
@@ -218,7 +218,7 @@ namespace FlaxEditor.Tools.Foliage
|
||||
|
||||
private void OnModified()
|
||||
{
|
||||
Editor.Instance.Scene.MarkSceneEdited(_proxy.Foliage?.Scene);
|
||||
Editor.Instance.Scene.MarkSceneEdited(_proxy.Foliage != null ? _proxy.Foliage.Scene : null);
|
||||
}
|
||||
|
||||
private void OnSelectedFoliageChanged()
|
||||
|
||||
Reference in New Issue
Block a user