Fix crash on find references in visject surface after grid snap has been added

This commit is contained in:
Wojtek Figat
2024-09-25 20:26:28 +02:00
parent 2ad9c7f4d5
commit 19817e4ad6

View File

@@ -132,7 +132,7 @@ namespace FlaxEditor.Surface
public virtual void OnSurfaceLoaded(SurfaceNodeActions action)
{
// Snap bounds (with ceil) when using grid snapping
if (Surface.GridSnappingEnabled)
if (Surface != null && Surface.GridSnappingEnabled)
{
var bounds = Bounds;
bounds.Location = Surface.SnapToGrid(bounds.Location, false);