2D Toolkit Forum

2D Toolkit => Support => Topic started by: kallekarkkainen on March 22, 2013, 05:40:47 pm

Title: NullReferenceException, sprite collection editor now working
Post by: kallekarkkainen on March 22, 2013, 05:40:47 pm
Hi,

I've got a problem with the sprite collection editor, as it will not show any content.

It spills these:
Code: [Select]
NullReferenceException: Object reference not set to an instance of an object
UnityEngine.GUILayoutUtility.DoGetRect (UnityEngine.GUIContent content, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options)
UnityEngine.GUILayoutUtility.GetRect (UnityEngine.GUIContent content, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options)
UnityEngine.GUILayout.DoTextField (System.String text, Int32 maxLength, Boolean multiline, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options)
UnityEngine.GUILayout.TextField (System.String text, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options)
tk2dSpriteCollectionEditorPopup.DrawToolbar () (at Assets/TK2DROOT/tk2d/Editor/Sprites/SpriteCollectionEditor/tk2dSpriteCollectionEditorPopup.cs:378)
tk2dSpriteCollectionEditorPopup.OnGUI () (at Assets/TK2DROOT/tk2d/Editor/Sprites/SpriteCollectionEditor/tk2dSpriteCollectionEditorPopup.cs:826)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Applications/buildAgent/work/b59ae78cff80e584/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)

followed by


ArgumentException: Getting control 2's position in a group with only 2 controls when doing Repaint
Aborting
UnityEngine.GUILayoutGroup.GetNext ()
UnityEngine.GUILayoutUtility.DoGetRect (UnityEngine.GUIContent content, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options)
UnityEngine.GUILayoutUtility.GetRect (UnityEngine.GUIContent content, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options)
UnityEngine.GUILayout.DoTextField (System.String text, Int32 maxLength, Boolean multiline, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options)
UnityEngine.GUILayout.TextField (System.String text, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options)
tk2dSpriteCollectionEditorPopup.DrawToolbar () (at Assets/TK2DROOT/tk2d/Editor/Sprites/SpriteCollectionEditor/tk2dSpriteCollectionEditorPopup.cs:378)
tk2dSpriteCollectionEditorPopup.OnGUI () (at Assets/TK2DROOT/tk2d/Editor/Sprites/SpriteCollectionEditor/tk2dSpriteCollectionEditorPopup.cs:826)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Applications/buildAgent/work/b59ae78cff80e584/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)




What can I do? I basically just created a sprite collection, and tried to open it's editor.

I'm on 4.1.0f4
Title: Re: NullReferenceException, sprite collection editor now working
Post by: kallekarkkainen on March 22, 2013, 05:51:02 pm
I researched it a bit further, added some debug lines along the skin part trying to find if there was something breaking in the skin. Then it started working (after restart). I don't even... *sigh*
Title: Re: NullReferenceException, sprite collection editor now working
Post by: unikronsoftware on March 22, 2013, 06:00:12 pm
I've had 4 reports of this. Not an alarming number, but still slightly worrying regardless.
In half of the cases it has been because of GUID corruption due to copying/sharing stuff without meta files.

How/when did this start happening?
Did you upgrade anything?
Title: Re: NullReferenceException, sprite collection editor now working
Post by: kallekarkkainen on March 23, 2013, 01:36:47 pm
How/when did this start happening?
Did you upgrade anything?

Well, if my memory serves it went exactly like this:

I don't think this fills the requirements for being labeled a heisenbug, as there is my project that transitioned from 4.0 to 4.1.

If you happen to figure it out, I'd really like to know.
Title: Re: NullReferenceException, sprite collection editor now working
Post by: unikronsoftware on March 23, 2013, 07:03:47 pm
I'll look into this. Thanks for the comprehensive report :)
What platform are you running on?