0
Fixed

Unity hierarchy conversion does not detect pseudo-null

Real World 3 years ago updated by Lazlo Bonin (Lead Developer) 3 years ago 4

I'm having a problem with this graph.

Arg 0 is null (or more specifically a SessionMenuBase object that intentionally hasn't been assigned to IslandLabel component "Client" in the inspector)

Inside my Simple Menu Session super unit I do a null check on session menu but I get an exception before it gets that far.

UnassignedReferenceException: The variable _sessionMenu of IslandLabel has not been assigned.
You probably need to assign the _sessionMenu variable of the IslandLabel script in the inspector.
Ludiq.ConversionUtility.UnityHierarchyConversion (System.Object value, System.Type type) (at C:/Users/Lazlo/Projects/Ludiq/Ludiq.Core/Runtime/Reflection/ConversionUtility.cs:453)
Ludiq.ConversionUtility.Convert (System.Object value, System.Type type, ConversionType conversionType) (at C:/Users/Lazlo/Projects/Ludiq/Ludiq.Core/Runtime/Reflection/ConversionUtility.cs:498)
Rethrow as InvalidConversionException: Failed to convert from 'UnityEngine.GameObject' to 'SessionMenuBase' via UnityHierarchy.
Ludiq.ConversionUtility.Convert (System.Object value, System.Type type, ConversionType conversionType) (at C:/Users/Lazlo/Projects/Ludiq/Ludiq.Core/Runtime/Reflection/ConversionUtility.cs:506)
Ludiq.ConversionUtility.Convert (System.Object value, System.Type type) (at C:/Users/Lazlo/Projects/Ludiq/Ludiq.Core/Runtime/Reflection/ConversionUtility.cs:215)
Bolt.XUnitValuePort.GetValue (IUnitValuePort gettable, Ludiq.Recursion recursion, System.Type type)
Bolt.GraphInput+<>c__DisplayClass1_0.<Definition>b__0 (Ludiq.Recursion recursion)
Bolt.ValueOutput.GetValue (Ludiq.Recursion recursion)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
MessengerExtensions.MessengerThatIncludesInactiveElements.InvokeIfExistsSafe (System.Object objectToCheck, System.String methodName, System.Object pParameter)
MessengerExtensions.MessengerThatIncludesInactiveElements.SendMessageSafe (UnityEngine.GameObject gameobject, System.String methodName, System.Object parameter)
UICamera.Notify (UnityEngine.GameObject go, System.String funcName, System.Object obj) (at Assets/NGUI/Scripts/UI/UICamera.cs:1895)
UICamera.ProcessRelease (Boolean isMouse, Single drag) (at Assets/NGUI/Scripts/UI/UICamera.cs:2784)
UICamera.ProcessTouch (Boolean pressed, Boolean released) (at Assets/NGUI/Scripts/UI/UICamera.cs:2834)
UICamera.ProcessMouse () (at Assets/NGUI/Scripts/UI/UICamera.cs:2257)
UICamera.ProcessTouches () (at Assets/NGUI/Scripts/UI/UICamera.cs:2371)
UICamera.ProcessEvents () (at Assets/NGUI/Scripts/UI/UICamera.cs:2071)
UICamera.Update () (at Assets/NGUI/Scripts/UI/UICamera.cs:2030)

If I attach the null to my Super Unit instead then it works as intended but the behaviour I would expect should be the same in both cases.

Bolt Version:
Unity Version:
Platform(s):
Scripting Backend:
.NET Version (API Compatibility Level):
GOOD, I'M SATISFIED
Satisfaction mark by Real World 3 years ago
Pending Review

Thanks for the report, I think I know what's happening, should be an easy fix!