NullReferenceException InventoryCanvas

r@t

New member
Hey, I'm having difficulty tracking down the cause of this bug. The data looks normal to me. It's throwing a NullReferenceException on the InventoryCanvas.

1685137807305.png

It appears to go away when deleting "Chest Menu" so i'm assuming that's the root cause.

1685138038770.png

1685137959329.png

Code:
NullReferenceException: Object reference not set to an instance of an object
Opsive.UltimateInventorySystem.UI.Grid.GridEventSystem.Initialize (UnityEngine.Vector2Int gridSize) (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/Grid/GridEventSystem.cs:105)
Opsive.UltimateInventorySystem.UI.Grid.GridBase.Initialize (System.Boolean force) (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/Grid/GridBase.cs:184)
Opsive.UltimateInventorySystem.UI.Grid.GridGeneric`1[T].Initialize (System.Boolean force) (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/Grid/GridGeneric.cs:54)
Opsive.UltimateInventorySystem.UI.Item.InventoryGrid.Initialize (System.Boolean force) (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/Item/InventoryGrid.cs:76)
Opsive.UltimateInventorySystem.UI.Menus.Chest.ChestMenu.Initialize (Opsive.UltimateInventorySystem.UI.Panels.DisplayPanel display, System.Boolean force) (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/Menus/Chest/ChestMenu.cs:78)
Opsive.UltimateInventorySystem.UI.Panels.DisplayPanel.Setup (Opsive.UltimateInventorySystem.UI.Panels.DisplayPanelManager manager, System.Boolean force) (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/Panels/DisplayPanel.cs:137)
Opsive.UltimateInventorySystem.UI.Panels.DisplayPanelManager.SetupDisplayPanels (System.Boolean force) (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/Panels/DisplayPanelManager.cs:129)
Opsive.UltimateInventorySystem.UI.Panels.DisplayPanelManager.SetPanelOwner (UnityEngine.GameObject panelOwner) (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/Panels/DisplayPanelManager.cs:155)
Opsive.UltimateInventorySystem.UI.Panels.DisplayPanelManager.Initialize (System.Boolean force) (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/Panels/DisplayPanelManager.cs:118)
Opsive.UltimateInventorySystem.UI.Panels.DisplayPanelManager.Awake () (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/Panels/DisplayPanelManager.cs:78)
 

Attachments

  • 1685137912352.png
    1685137912352.png
    18.3 KB · Views: 3
Checking the error line, it looks like you have something inside your Grid that is not an ItemViewSlot.
Make sure that everything that is inside this content are ItemViewSlots. Nothing else.
1685266391247.png


I will add a better error message, so that it can be easily identified.
 
Hey, so turns out you were right about the issue!
For some strange reason my new "chest menu" creation adds "item view for grid" (item view NOT item view slot)

1685278273272.png

Here I manually cleared it out and replaced/duplicated it and now things work. Any ideas on how to fix the creation menu from propagating the wrong data? The item view slot seems to be suggesting it's correctly linked and I've deleted/created this menu fresh from the UI Designer.

1685278506103.png

Here's the issue being fixed below:
1685278355990.png

Fixed, Thanks!

1685278383021.png
 

Attachments

  • 1685278327238.png
    1685278327238.png
    23.8 KB · Views: 0
I'm glad you were able to fix your issue.

Here I manually cleared it out and replaced/duplicated it and now things work. Any ideas on how to fix the creation menu from propagating the wrong data?
Unfortunatly I don't think that is possible.
I will take note of it just in case
 
Top