From 0b816d786612c6a4c606d4237e0079bb6bbce1fa Mon Sep 17 00:00:00 2001 From: Jeremy Vidaurri Date: Thu, 12 Sep 2024 19:10:25 -0500 Subject: [PATCH] fix: prevent crash --- Randomizer/RandoLogic/LogicPathway.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Randomizer/RandoLogic/LogicPathway.cs b/Randomizer/RandoLogic/LogicPathway.cs index 15c549a7..706bc74d 100644 --- a/Randomizer/RandoLogic/LogicPathway.cs +++ b/Randomizer/RandoLogic/LogicPathway.cs @@ -141,7 +141,7 @@ public override bool Next() var closure = LinkedNodeSet.Closure(this.Node, caps, null, true); var available = closure.UnlinkedEdges(u => { // ensure first hole is up or right - var flag = this.Logic.CompletedTasks.Count != 1 || (u.Static.HoleTarget.Side != ScreenDirection.Down && u.Static.HoleTarget.Side != ScreenDirection.Left); + var flag = this.Logic.CompletedTasks.Count != 1 || (u.Static.HoleTarget?.Side != ScreenDirection.Down && u.Static.HoleTarget?.Side != ScreenDirection.Left); return !this.TriedEdges.Contains(u.Static) && (u.Static.HoleTarget == null || (!this.ForceWarp && this.Logic.Map.HoleFree(this.Node.Room, u.Static.HoleTarget) && flag)); }); if (available.Count == 0)