Skip to content

Commit 986d602

Browse files
-Assign brushTarget GridLayout only if it exists (#304)
1 parent 592e80b commit 986d602

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Editor/Brushes/GameObjectBrush/GameObjectBrush.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,11 @@ private void GetGrid(ref GridLayout gridLayout, ref GameObject brushTarget)
349349
if (brushTarget == hiddenGrid)
350350
brushTarget = null;
351351
if (brushTarget != null)
352-
gridLayout = brushTarget.GetComponent<GridLayout>();
352+
{
353+
var targetGridLayout = brushTarget.GetComponent<GridLayout>();
354+
if (targetGridLayout != null)
355+
gridLayout = targetGridLayout;
356+
}
353357
}
354358

355359
/// <summary>Clears all data of the brush.</summary>

0 commit comments

Comments
 (0)