From b8612f72d77bce97a6fecc7c177c11c692f213ec Mon Sep 17 00:00:00 2001 From: AJ Date: Wed, 1 Oct 2025 23:25:43 -0400 Subject: [PATCH] Fix null reference risk in BestFitEngine --- SawCut/Nesting/BestFitEngine.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/SawCut/Nesting/BestFitEngine.cs b/SawCut/Nesting/BestFitEngine.cs index e67717b..2ae4500 100644 --- a/SawCut/Nesting/BestFitEngine.cs +++ b/SawCut/Nesting/BestFitEngine.cs @@ -65,7 +65,10 @@ namespace SawCut.Nesting } } - best_bin.Items.Add(item); + if (best_bin != null) + best_bin.Items.Add(item); + + } return bins