Unity 2019.2.4f1, AC 1.70.2
To reproduce, in a fresh 2D Project with default settings (except that the Container Menu should be "Unity UI Prefab"):
-Add a Container, limited by Category
_Then try and drag an Item from the Player's Inventory that is NOT in that Category, into the Container
This will produce a Null Reference Exception as detailed below
...
NullReferenceException: Object reference not set to an instance of an object
AC.MenuInventoryBox.ClickContainer (AC.MouseState _mouseState, System.Int32 _slot) (at Assets/AdventureCreator/Scripts/Menu/Menu classes/MenuInventoryBox.cs:1919)
AC.RuntimeInventory.ProcessInventoryBoxClick (AC.Menu _menu, AC.MenuInventoryBox inventoryBox, System.Int32 _slot, AC.MouseState _mouseState) (at Assets/AdventureCreator/Scripts/Inventory/RuntimeInventory.cs:1894)
AC.MenuInventoryBox.ProcessClick (AC.Menu _menu, System.Int32 _slot, AC.MouseState _mouseState) (at Assets/AdventureCreator/Scripts/Menu/Menu classes/MenuInventoryBox.cs:1987)
AC.MenuElement.ProcessClickUI (AC.Menu _menu, System.Int32 _slot, AC.MouseState _mouseState) (at Assets/AdventureCreator/Scripts/Menu/Menu classes/MenuElement.cs:242)
AC.MenuElement+<>c__DisplayClass37_0.b__0 () (at Assets/AdventureCreator/Scripts/Menu/Menu classes/MenuElement.cs:209)
UnityEngine.Events.InvokableCall.Invoke () (at C:/buildslave/unity/build/Runtime/Export/UnityEvent/UnityEvent.cs:166)
UnityEngine.Events.UnityEvent.Invoke () (at C:/buildslave/unity/build/Runtime/Export/UnityEvent/UnityEvent/UnityEvent_0.cs:58)
UnityEngine.UI.Button.Press () (at <6600e63ff3734c37bb16ea12f410fcd2>:0)
UnityEngine.UI.Button.OnPointerClick (UnityEngine.EventSystems.PointerEventData eventData) (at <6600e63ff3734c37bb16ea12f410fcd2>:0)
UnityEngine.EventSystems.ExecuteEvents.Execute (UnityEngine.EventSystems.IPointerClickHandler handler, UnityEngine.EventSystems.BaseEventData eventData) (at <6600e63ff3734c37bb16ea12f410fcd2>:0)
UnityEngine.EventSystems.ExecuteEvents.Execute[T] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.ExecuteEvents+EventFunction`1[T1] functor) (at <6600e63ff3734c37bb16ea12f410fcd2>:0)
UnityEngine.EventSystems.StandaloneInputModule:ProcessMouseEvent()
AC.OptionalMouseInputModule:Process() (at Assets/AdventureCreator/Scripts/Menu/OptionalMouseInputModule.cs:158)
UnityEngine.EventSystems.EventSystem:Update()
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
Thanks, I'll look into it.
In MenuInventoryBox, replace line 1919:
with: