Forums › 💬 NodeCanvas › ⚙️ Support › ArgumentNullException › Reply To: ArgumentNullException
Hello,
I wasn’t checking for whether or not the accessor is private. Here is the fix.
Please replace VariableData.cs InitBinding method at line #111 with the following:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
///Set the gameobject target for property binding. public override void InitBinding(GameObject go){ if (hasBinding && Application.isPlaying){ getter = null; setter = null; var arr = _propertyPath.Split('.'); var comp = go.GetComponent( arr[0] ); if (comp != null){ var prop = comp.GetType().NCGetProperty(arr[1]); if (prop != null){ if (prop.CanRead){ MethodInfo getMethod = null; #if NETFX_CORE getMethod = prop.GetMethod; #else getMethod = prop.GetGetMethod(); #endif if (getMethod != null){ getter = getMethod.NCCreateDelegate<System.Func<T>>(comp); } else { Debug.Log(string.Format("Binded Property '{0}' on '{1}' get accessor is private. Get binding ignored", prop.Name, comp.GetType().Name)); } } if (prop.CanWrite){ MethodInfo setMethod = null; #if NETFX_CORE setMethod = prop.SetMethod; #else setMethod = prop.GetSetMethod(); #endif if (setMethod != null){ setter = setMethod.NCCreateDelegate<System.Action<T>>(comp); } else { Debug.Log(string.Format("Binded Property '{0}' on '{1}' set accessor is private. Set binding ignored", prop.Name, comp.GetType().Name)); } } } } } } |
Cheers!
