Added safeguard to MapSet.NearestLinedefRange if selectionmap is null. Might fix #529.

This commit is contained in:
biwa 2021-02-20 13:11:03 +01:00 committed by spherallic
parent 0eee76393b
commit c27bf325ad

View file

@ -3387,6 +3387,9 @@ namespace CodeImp.DoomBuilder.Map
/// <summary>This finds the line closest to the specified position.</summary> /// <summary>This finds the line closest to the specified position.</summary>
public static Linedef NearestLinedefRange(BlockMap<BlockEntry> selectionmap, Vector2D pos, float maxrange) //mxd public static Linedef NearestLinedefRange(BlockMap<BlockEntry> selectionmap, Vector2D pos, float maxrange) //mxd
{ {
if (selectionmap == null)
return null;
Linedef closest = null; Linedef closest = null;
float distance = float.MaxValue; float distance = float.MaxValue;
float maxrangesq = maxrange * maxrange; float maxrangesq = maxrange * maxrange;