Skip to content

Commit 4f198dc

Browse files
committed
Fix crash in MapUI.MouseMove when a cursor action deactivates itself on LeftDown
1 parent ff1c6a4 commit 4f198dc

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/TSMapEditor/UI/MapUI.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,9 @@ public override void OnMouseMove()
496496
}
497497
}
498498

499-
CursorAction.MouseMove(tileUnderCursor == null ? Point2D.NegativeOne : tileUnderCursor.CoordsToPoint());
499+
// Re-check for null in case the cursor action exited itself on LeftDown
500+
if (CursorAction != null)
501+
CursorAction.MouseMove(tileUnderCursor == null ? Point2D.NegativeOne : tileUnderCursor.CoordsToPoint());
500502
}
501503

502504
// Right-click scrolling

0 commit comments

Comments
 (0)