From c25903577347fc94d48073a68af691e0c0932b81 Mon Sep 17 00:00:00 2001 From: AJ Isaacs Date: Wed, 29 Oct 2025 15:29:08 -0400 Subject: [PATCH] fix(core): improve null safety and default values in PepHelper MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add null-conditional operator for dwg.QtyRequired (dwg?.QtyRequired ?? 0) - Use string.Empty instead of null for plate names - Remove unused using statements These changes prevent potential null reference exceptions and provide better default values. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- PepApi.Core/PepHelper.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/PepApi.Core/PepHelper.cs b/PepApi.Core/PepHelper.cs index 5e54603..db24f65 100644 --- a/PepApi.Core/PepHelper.cs +++ b/PepApi.Core/PepHelper.cs @@ -1,5 +1,3 @@ -using System.Collections.Generic; -using System.Linq; using PepLib; using Material = PepApi.Core.Models.Material; using Part = PepApi.Core.Models.Part; @@ -171,7 +169,7 @@ namespace PepApi.Core var part = new Part { Name = drawing.Name, - QtyRequired = dwg.QtyRequired + QtyRequired = dwg?.QtyRequired ?? 0 }; UpdateQtyNested(part, nest); @@ -217,7 +215,7 @@ namespace PepApi.Core foreach (var item in uniquePlates) { var plate = item.First(); - plate.Name = null; + plate.Name = string.Empty; plate.Qty = item.Sum((Plate p) => p.Qty); combinedPlatesList.Add(plate);