- Home /
NullReferenceException pointing nowhere
I get a strange NullReferenceException when I start Unity or the game. The game and editor both run fine though. The exception points nowhere if I click it, so I'm not able to track down the cause. It appears exactly 494 times in the blink of an eye and then stops. Googling it doesn't find me a single entry. Anyone able to read a possible clue out of it?
NullReferenceException: (null)
UnityEditor.SerializedObject..ctor (UnityEngine.Object[] objs, UnityEngine.Object context) (at C:/buildslave/unity/build/artifacts/generated/common/editor/SerializedPropertyBindings.gen.cs:87)
UnityEditor.Editor.GetSerializedObjectInternal () (at C:/buildslave/unity/build/artifacts/generated/common/editor/EditorBindings.gen.cs:193)
UnityEditor.Editor.get_serializedObject () (at C:/buildslave/unity/build/artifacts/generated/common/editor/EditorBindings.gen.cs:185)
UnityEditor.GameObjectInspector.OnEnable () (at C:/buildslave/unity/build/Editor/Mono/Inspector/GameObjectInspector.cs:83)
Thank you in advance!
no idea get similar thing thought NullReferenceException: Object reference not set to an instance of an object UnityEditor.GameObjectInspector.ClearPreviewCache () (at C:/buildslave/unity/build/Editor/$$anonymous$$ono/Inspector/GameObjectInspector.cs:211) UnityEditor.GameObjectInspector.OnDisable () (at C:/buildslave/unity/build/Editor/$$anonymous$$ono/Inspector/GameObjectInspector.cs:205)
Answer by TonicMind · Nov 07, 2018 at 03:26 AM
This is the singular most common problem new game devs encounter in programming. A Null reference means that the variable you're using points to nothing. If you want the player to pause on this error, within the console window you need to click on "Error pause".
Then the game will stop on any errors that you get. Go from there. Another thing, click on "Show duplicates" (or something like that) to see one error message for all of those 494 errors.
If you take a closer look at the error, you will see the problem comes from Unity....
C:/buildslave/unity/build/Editor/$$anonymous$$ono/Inspector/GameObjectInspector.cs:205
Whch version of Unity are you using? If you think its a bug, you ought to report it to Unity Tech via the bug tracker. Otherwise just ignore it. I think I've had this problem a few times.
I think a good idea would be to post a screenshot and maybe I could debug it from here.
Answer by swanijam · Nov 07, 2018 at 02:41 PM
Whenever I get errors from Unity's own library code, I close my project and delete /Temp and /Library. After reopening, the problems are usually gone. It could be worth a shot.
Your answer

Follow this Question
Related Questions
NullReferenceException: Object reference not set to an instance of an object 0 Answers
NullReferenceException on empty project because of ScriptCompilerBase 0 Answers
Vector3.Distance giving me NullReferenceException every time 1 Answer
Program received signal: “SIGABRT” 0 Answers
NullReferenceException Error 6 Answers