NullReferenceException when creating a new ItemSetRulesObject

airoll

Member
Hello,

I have recently upgrade to the latest versions of UIS (1.1.7) and UCC (2.3.4), as well as the integration. When I try to create an ItemSetRulesObject from the InventoryItemSetManager, I keep getting the following error. It creates the ScriptableObject but I'm not able to actually modify any item sets. I've also tried this in a fresh project and am running into the same issues.

Code:
[Exception] NullReferenceException: Object reference not set to an instance of an object
ItemSetRulesObject.Initialize() at /Opsive/UltimateCharacterController/Integrations/UltimateInventorySystem/Scripts/ItemSet/ItemSetRulesObject.cs:67

ItemSetRulesObjectInspector.InitializeInspector() at /Opsive/UltimateCharacterController/Integrations/UltimateInventorySystem/Editor/ItemSetRulesObjectInspector.cs:44

DatabaseInspectorBase.DrawInOrder() at /Opsive/UltimateInventorySystem/Editor/Inspectors/DatabaseInspectorBase.cs:46

Opsive.UltimateInventorySystem.Editor.VisualElements.NestedScriptableObjectInspector`2[To,Ti].Refresh() at /Opsive/UltimateInventorySystem/Editor/VisualElements/NestedScriptableObjectInspector.cs:77

Opsive.UltimateInventorySystem.Editor.VisualElements.ObjectFieldWithNestedInspector`2[To,Ti].<.ctor>b__8_1() at /Opsive/UltimateInventorySystem/Editor/VisualElements/NestedScriptableObjectInspector.cs:122

Opsive.UltimateInventorySystem.Editor.VisualElements.NestedScriptableObjectInspector`2+<>c__DisplayClass2_0[To,Ti].<.ctor>b__0() at /Opsive/UltimateInventorySystem/Editor/VisualElements/NestedScriptableObjectInspector.cs:49

Clickable.Invoke() at <001bec72e88e4f3a9eb0246a4215b1a5>:0

Clickable.ProcessUpEvent() at <001bec72e88e4f3a9eb0246a4215b1a5>:0

Clickable.OnMouseUp() at <001bec72e88e4f3a9eb0246a4215b1a5>:0

UnityEngine.UIElements.EventCallbackFunctor`1[TEventType].Invoke() at <001bec72e88e4f3a9eb0246a4215b1a5>:0

EventCallbackRegistry.InvokeCallbacks() at <001bec72e88e4f3a9eb0246a4215b1a5>:0

CallbackEventHandler.HandleEvent() at <001bec72e88e4f3a9eb0246a4215b1a5>:0

CallbackEventHandler.HandleEventAtTargetPhase() at <001bec72e88e4f3a9eb0246a4215b1a5>:0

MouseCaptureDispatchingStrategy.DispatchEvent() at <001bec72e88e4f3a9eb0246a4215b1a5>:0

EventDispatcher.ApplyDispatchingStrategies() at <001bec72e88e4f3a9eb0246a4215b1a5>:0

EventDispatcher.ProcessEvent() at <001bec72e88e4f3a9eb0246a4215b1a5>:0

EventDispatcher.ProcessEventQueue() at <001bec72e88e4f3a9eb0246a4215b1a5>:0

EventDispatcher.OpenGate() at <001bec72e88e4f3a9eb0246a4215b1a5>:0

EventDispatcherGate.Dispose() at <001bec72e88e4f3a9eb0246a4215b1a5>:0

EventDispatcher.ProcessEvent() at <001bec72e88e4f3a9eb0246a4215b1a5>:0

EventDispatcher.Dispatch() at <001bec72e88e4f3a9eb0246a4215b1a5>:0

BaseVisualElementPanel.SendEvent() at <001bec72e88e4f3a9eb0246a4215b1a5>:0

UIElementsUtility.DoDispatch() at <001bec72e88e4f3a9eb0246a4215b1a5>:0

UnityEngine.UIElements.UIElementsUtility.UnityEngine.UIElements.IUIElementsUtility.ProcessEvent() at <001bec72e88e4f3a9eb0246a4215b1a5>:0

UIEventRegistration.ProcessEvent() at <001bec72e88e4f3a9eb0246a4215b1a5>:0

UnityEngine.UIElements.UIEventRegistration+<>c.<.cctor>b__1_2() at <001bec72e88e4f3a9eb0246a4215b1a5>:0

GUIUtility.ProcessEvent() at <6ddf8eac3856492ab1b8cf42618915cc>:0
 
Hi airoll,
This is a known bug that I fixed but haven't made the fix public yet.

In the ItemSetRuleObject script on line 67 where you have an error add a null check:
Code:
if (m_CategoryItemSetRules == null) {
    m_CategoryItemSetRules = new CategoryItemSetRule[0];
}

We should be releasing an update around the end of the month with a lot of bug fixes and some useful new features
 
Last edited:
Top