From 008fb8fd941febf8d929060676a8da1db1ed9d10 Mon Sep 17 00:00:00 2001 From: Chomp Date: Sun, 26 Jan 2025 21:33:19 +0000 Subject: [PATCH] Fixed nullref in AddExtraMagazinesToInventory --- Libraries/Core/Helpers/BotGeneratorHelper.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Libraries/Core/Helpers/BotGeneratorHelper.cs b/Libraries/Core/Helpers/BotGeneratorHelper.cs index 2da6c971..dc68043b 100644 --- a/Libraries/Core/Helpers/BotGeneratorHelper.cs +++ b/Libraries/Core/Helpers/BotGeneratorHelper.cs @@ -42,7 +42,13 @@ public class BotGeneratorHelper( .GetLatestValue(ContextVariableType.RAID_CONFIGURATION) ?.GetValue(); var raidIsNight = raidSettings?.TimeVariant == DateTimeEnum.PAST; - _botConfig.LootItemResourceRandomization.TryGetValue(botRole, out var randomisationSettings); + + RandomisedResourceDetails randomisationSettings = null; + if (botRole is not null) + { + _botConfig.LootItemResourceRandomization.TryGetValue(botRole, out randomisationSettings); + } + Upd itemProperties = new(); var hasProperties = false;