BUG: Add a missing null check for the source character in InventoryCraft()

This commit is contained in:
bananarama92 2025-03-19 11:36:12 +01:00
parent c4acdfd338
commit 75c64f96bc
No known key found for this signature in database
GPG key ID: E83C7D3B5DA36248

View file

@ -689,7 +689,7 @@ function InventoryCraft(Source, Target, GroupName, Craft, Refresh, PreConfigureI
// Gets the item first
if ((Target == null) || (GroupName == null)) return;
let Item = InventoryGet(Target, GroupName);
if ((Item == null) || !CraftingValidate(Craft, Item.Asset, CraftWarn, Source.IsPlayer())) return;
if ((Item == null) || !CraftingValidate(Craft, Item.Asset, CraftWarn, Source?.IsPlayer())) return;
Item.Craft ??= Craft;
Item.Property ??= {};