From ec035254420286ff5fc108de17f2efcd7aa3f8a4 Mon Sep 17 00:00:00 2001 From: Benjamin Popp Date: Sat, 26 Dec 2020 22:58:19 -0600 Subject: [PATCH] Fix a debug only crash. In the case it found, it shouldn't crash, but should instead assert. --- src/HexManiac.Core/Models/HardcodeTablesModel.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/HexManiac.Core/Models/HardcodeTablesModel.cs b/src/HexManiac.Core/Models/HardcodeTablesModel.cs index b10137c5..2aa1ceb4 100644 --- a/src/HexManiac.Core/Models/HardcodeTablesModel.cs +++ b/src/HexManiac.Core/Models/HardcodeTablesModel.cs @@ -130,7 +130,7 @@ namespace HavenSoft.HexManiac.Core.Models { [Conditional("DEBUG")] private void CheckForEmptyAnchors(int destination, string anchor) { var run = GetNextRun(destination); - Debug.Assert(run.PointerSources.Count > 0, $"{anchor} refers to {destination:X6}, but has no pointers. So how did we find it?"); + Debug.Assert(run.PointerSources == null || run.PointerSources.Count > 0, $"{anchor} refers to {destination:X6}, but has no pointers. So how did we find it?"); } private void DecodeHeader() {