Author Topic: NullReferenceException from NGUITransformInspector?  (Read 5250 times)

vexe

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 153
    • View Profile
NullReferenceException from NGUITransformInspector?
« on: February 13, 2014, 03:06:33 AM »
Been getting this error quite a lot recently even with the latest NGUI so I thought you should know about it.

  1. NullReferenceException: (null)
  2. UnityEditor.SerializedObject..ctor (UnityEngine.Object[] objs) (at C:/BuildAgent/work/d3d49558e4d408f4/artifacts/EditorGenerated/SerializedPropertyBindings.cs:69)
  3. UnityEditor.Editor.GetSerializedObjectInternal () (at C:/BuildAgent/work/d3d49558e4d408f4/artifacts/EditorGenerated/EditorBindings.cs:117)
  4. UnityEditor.Editor.get_serializedObject () (at C:/BuildAgent/work/d3d49558e4d408f4/artifacts/EditorGenerated/EditorBindings.cs:110)
  5. NGUITransformInspector.OnEnable () (at Assets/External/NGUI/Scripts/Editor/NGUITransformInspector.cs:168)
  6.  

It happens during editor-time - My console gets blown with +999 errors.

There's also the same error for GameObjectInspector too - "Inspector/GameObjectInspector.cs:91"

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: NullReferenceException from NGUITransformInspector?
« Reply #1 on: February 13, 2014, 03:18:23 AM »
That points to 'serializedObject' being null, which shouldn't be possible. I suggest reporting it as a bug in Unity. I'm guessing you're on the latest 4.6 beta version? I've never seen it in the release.

vexe

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 153
    • View Profile
Re: NullReferenceException from NGUITransformInspector?
« Reply #2 on: February 13, 2014, 03:23:17 AM »
No I'm using 4.3.3f1

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: NullReferenceException from NGUITransformInspector?
« Reply #3 on: February 13, 2014, 03:32:19 AM »
4.3.4 here. I think I went from 4.3.2 straight to 4.3.4.

vexe

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 153
    • View Profile
Re: NullReferenceException from NGUITransformInspector?
« Reply #4 on: February 13, 2014, 03:33:36 AM »
I keep an eye close to the release notes. I didn't see anything worth updating to 4.3.4 so I just didn't do it. I'll update and let you know if I still get the error.

NaxIonz

  • Jr. Member
  • **
  • Thank You
  • -Given: 3
  • -Receive: 0
  • Posts: 70
    • View Profile
Re: NullReferenceException from NGUITransformInspector?
« Reply #5 on: June 10, 2016, 03:39:53 PM »
Started getting this quite often once we updated to Unity 5 (never got it on 4.x.y)

Currently on 5.4.3p4

Ony

  • Newbie
  • *
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 7
    • View Profile
Re: NullReferenceException from NGUITransformInspector?
« Reply #6 on: July 07, 2016, 02:55:05 PM »
Yup, getting this now using v. 5.3.5

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: NullReferenceException from NGUITransformInspector?
« Reply #7 on: July 11, 2016, 01:13:44 AM »
Apparently Unity broke something on their end in the editor. You can just add a try/catch block to get rid of that error. NGUITransformInspector.OnEnable:
  1.         void OnEnable ()
  2.         {
  3.                 instance = this;
  4.  
  5.                 if (this)
  6.                 {
  7.                         try
  8.                         {
  9.                                 var so = serializedObject;
  10.                                 mPos = so.FindProperty("m_LocalPosition");
  11.                                 mRot = so.FindProperty("m_LocalRotation");
  12.                                 mScale = so.FindProperty("m_LocalScale");
  13.                         }
  14.                         catch {}
  15.                 }
  16.         }