From a69d83b50dc62a0932a435333c615a992d3a9491 Mon Sep 17 00:00:00 2001 From: Dev Date: Sun, 13 Aug 2023 16:34:06 +0100 Subject: [PATCH] Nullguard --- .../DumpProcessor/MultithreadSteppedDumpProcessor.cs | 6 +++++- Process/Processor/StaticLootProcessor.cs | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Process/Processor/DumpProcessor/MultithreadSteppedDumpProcessor.cs b/Process/Processor/DumpProcessor/MultithreadSteppedDumpProcessor.cs index e4a10de..b4b191c 100644 --- a/Process/Processor/DumpProcessor/MultithreadSteppedDumpProcessor.cs +++ b/Process/Processor/DumpProcessor/MultithreadSteppedDumpProcessor.cs @@ -140,7 +140,11 @@ public class MultithreadSteppedDumpProcessor : IDumpProcessor { if (mapName == "Streets of Tarkov") { - return Math.Round((double)(LootDumpProcessorContext.GetTarkovItems().GetProbabilityByContainerId(td.Key.Id).probability), 2); + var result = LootDumpProcessorContext.GetTarkovItems().GetProbabilityByContainerId(td.Key.Id); + if (result != null) + { + return Math.Round((double)(result.probability), 2); + } } return Math.Round((double)((decimal)td.Value / (decimal)mapDumpCounter[mapName]), 2); diff --git a/Process/Processor/StaticLootProcessor.cs b/Process/Processor/StaticLootProcessor.cs index bedbd3f..7f8dc79 100644 --- a/Process/Processor/StaticLootProcessor.cs +++ b/Process/Processor/StaticLootProcessor.cs @@ -66,6 +66,7 @@ public class StaticLootProcessor foreach (var item in data) { + // remove all but first item from containers items item.Items = new List { item.Items[0] }; }