Page MenuHomeFeedback Tracker

Inventory system is missing a null check causing errors in 0.9.6 exp
Closed, ResolvedPublic

Description

In some (also modding-related) scenarios by the time the SCR_InvCallBack is executed the OnItemAdded or other events might have deleted it already, causing the line:
enfusion://ScriptEditor/Scripts/Game/UI/Inventory/SCR_InventoryMenuUI.c;94

auto itemStorage = BaseInventoryStorageComponent.Cast(m_pItem.FindComponent(BaseInventoryStorageComponent));

to throw a null pointer exception. Please add a simple if(m_pItem) check before trying to get the component. The check is in place for other cases already in the code, just not this one.

enfusion://ScriptEditor/Scripts/Game/Inventory/SCR_InventoryStorageManagerComponent.c;280

RplComponent rplComp = RplComponent.Cast(entity.FindComponent(RplComponent));

Similar situation here ...

Details

Severity
Crash
Resolution
Open
Reproducibility
Always
Operating System
Windows 10 x64
Category
General

Event Timeline

Arkensor created this task.Oct 1 2022, 12:08 PM
Arkensor renamed this task from SCR_InvCallBack is missing a null check causing errors in 0.9.6 exp to Inventory system is missing a null check causing errors in 0.9.6 exp.Oct 1 2022, 12:14 PM
Arkensor updated the task description. (Show Details)
Geez changed the task status from New to Awaiting internal Testing.Oct 6 2022, 2:02 PM
Geez closed this task as Resolved.Nov 10 2022, 2:51 PM
Geez claimed this task.
Geez added a subscriber: Geez.

Hello Arkensor.
The issue has been resolved internally and the fix will appear in one of the upcoming updates.
Regards,
Geez