diff --git a/Libraries/SPTarkov.Server.Core/Services/PostDbLoadService.cs b/Libraries/SPTarkov.Server.Core/Services/PostDbLoadService.cs index dccebad4..7de71703 100644 --- a/Libraries/SPTarkov.Server.Core/Services/PostDbLoadService.cs +++ b/Libraries/SPTarkov.Server.Core/Services/PostDbLoadService.cs @@ -382,7 +382,7 @@ public class PostDbLoadService( { var itemDb = databaseService.GetItems(); - var shotguns = new List + var shotguns = new List { Weapons.SHOTGUN_12G_SAIGA_12K, Weapons.SHOTGUN_20G_TOZ_106, @@ -391,9 +391,9 @@ public class PostDbLoadService( }; foreach (var shotgunId in shotguns) { - if (itemDb[shotgunId].Properties.ShotgunDispersion.HasValue) + if (itemDb.TryGetValue(shotgunId, out var shotgun) && shotgun.Properties.ShotgunDispersion.HasValue) { - itemDb[shotgunId].Properties.shotgunDispersion = itemDb[shotgunId].Properties.ShotgunDispersion; + shotgun.Properties.shotgunDispersion = shotgun.Properties.ShotgunDispersion; } } }