From e9f6a402f71a8dceccd69ac847ae38f2c21515c8 Mon Sep 17 00:00:00 2001 From: Chomp Date: Wed, 16 Jul 2025 10:43:17 +0100 Subject: [PATCH] Fixed nullref issue when healing post-raid --- .../SPTarkov.Server.Core/Controllers/HealthController.cs | 4 ++-- .../Models/Eft/Health/HealthTreatmentRequestData.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Libraries/SPTarkov.Server.Core/Controllers/HealthController.cs b/Libraries/SPTarkov.Server.Core/Controllers/HealthController.cs index 920145d6..ddd9c3db 100644 --- a/Libraries/SPTarkov.Server.Core/Controllers/HealthController.cs +++ b/Libraries/SPTarkov.Server.Core/Controllers/HealthController.cs @@ -293,7 +293,7 @@ public class HealthController( TransactionId = Traders.THERAPIST, SchemeItems = healthTreatmentRequest.Items, Type = "", - ItemId = "", + ItemId = MongoId.Empty(), Count = 0, SchemeId = 0, }; @@ -320,7 +320,7 @@ public class HealthController( } // Check for effects to remove - if (partRequest.Effects.Count > 0) + if (partRequest.Effects?.Count > 0) { // Found some, loop over them and remove from pmc profile foreach (var effect in partRequest.Effects) diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Health/HealthTreatmentRequestData.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Health/HealthTreatmentRequestData.cs index 083910e4..6b8df8ff 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Health/HealthTreatmentRequestData.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Health/HealthTreatmentRequestData.cs @@ -78,5 +78,5 @@ public record BodyPartEffects /// /// Effects in array to be removed /// - public List Effects { get; set; } + public List? Effects { get; set; } }