From 11a7b4fdbd5cd50e6697ad4c38e56d41af1696d2 Mon Sep 17 00:00:00 2001 From: CWX Date: Mon, 10 Feb 2025 21:09:25 +0000 Subject: [PATCH] make sure there are props to override before iterating --- Libraries/Core/Services/Mod/CustomItemService.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Libraries/Core/Services/Mod/CustomItemService.cs b/Libraries/Core/Services/Mod/CustomItemService.cs index 9b73e0d3..f87bfd16 100644 --- a/Libraries/Core/Services/Mod/CustomItemService.cs +++ b/Libraries/Core/Services/Mod/CustomItemService.cs @@ -140,6 +140,11 @@ public class CustomItemService( */ protected void UpdateBaseItemPropertiesWithOverrides(Props? overrideProperties, TemplateItem itemClone) { + if (overrideProperties is null) + { + return; + } + foreach (var propKey in overrideProperties.GetAllPropsAsDict()) { itemClone.Properties.GetAllPropsAsDict()[propKey.Key] = overrideProperties.GetAllPropsAsDict()[propKey.Key]; @@ -186,7 +191,7 @@ public class CustomItemService( * e.g. * en[0] * fr[1] - * + * * No jp provided, so english will be used as a substitute * @param localeDetails key is language, value are the new locale details * @param newItemId id of the item being created