Author Topic: More Null Reference Issues  (Read 7950 times)

Disastercake

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 87
  • www.disastercake.com
    • View Profile
    • Disastercake
More Null Reference Issues
« on: March 20, 2013, 06:06:47 PM »
I have one panel that is constantly throwing errors, and the only way to fix it is if I leave the panel enabled when the game starts.  What happens is, I go to the menu that will enable the panel for the first time, which throws the follow error twice:
  1. NullReferenceException: Object reference not set to an instance of an object
  2. UISprite.SimpleFill (.BetterList`1 verts, .BetterList`1 uvs, .BetterList`1 cols) (at Assets/NGUI/Scripts/UI/UISprite.cs:561)
  3. UISprite.OnFill (.BetterList`1 verts, .BetterList`1 uvs, .BetterList`1 cols) (at Assets/NGUI/Scripts/UI/UISprite.cs:523)
  4. UIWidget.UpdateGeometry (UnityEngine.Matrix4x4& worldToPanel, Boolean parentMoved, Boolean generateNormals) (at Assets/NGUI/Scripts/Internal/UIWidget.cs:497)
  5. UIPanel.UpdateWidgets () (at Assets/NGUI/Scripts/UI/UIPanel.cs:848)
  6. UIPanel.LateUpdate () (at Assets/NGUI/Scripts/UI/UIPanel.cs:983)
  7.  

Everything appears fine, and the game continues as normal.  However, if I close this menu (which disabled the panel) then reopen it, I am spammed with the following error every frame:
  1. NullReferenceException: Object reference not set to an instance of an object
  2. UIGeometry.WriteToBuffers (.BetterList`1 v, .BetterList`1 u, .BetterList`1 c, .BetterList`1 n, .BetterList`1 t) (at Assets/NGUI/Scripts/Internal/UIGeometry.cs:111)
  3. UIWidget.WriteToBuffers (.BetterList`1 v, .BetterList`1 u, .BetterList`1 c, .BetterList`1 n, .BetterList`1 t) (at Assets/NGUI/Scripts/Internal/UIWidget.cs:525)
  4. UIPanel.Fill (UnityEngine.Material mat) (at Assets/NGUI/Scripts/UI/UIPanel.cs:927)
  5. UIPanel.LateUpdate () (at Assets/NGUI/Scripts/UI/UIPanel.cs:993)
  6.  

Nothing in the menu VISUALLY appears, however all of the colliders, onHover, onClick, etc commands work perfectly.  It's just that nothing will show up.  However, leaving the panel and objects enabled from the beginning, then disabling them after launch, will not throw these errors.

This is something I've been trying to trouble shoot for 2 patches that you were blaming on bad updating procedures, but I had followed the instructions.  I have also rebuilt this panel 3 times now, each time resulting in the same thing eventually.  When I first build the panel, it throws the errors only one per play of the game, but if I exit Unity and restart, the issues above happen.

My guess is you changed something in one of the last 2 or 3 patches that is screwing up how it caches objects if they are disabled.  This may have been on purpose or not.  Also, I find it weird that only this panel gives me issues, and not any of the others (especially since I've rebuilt the panel over and over).
Creator of Soul Saga.
http://www.disastercake.com

Disastercake

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 87
  • www.disastercake.com
    • View Profile
    • Disastercake
Re: More Null Reference Issues
« Reply #1 on: March 20, 2013, 08:19:21 PM »
After testing this further, the issue is actually not truly fixed by leaving it enabled in the beginning.

In the editor, this fixes it, but playing a build of the game still makes the textures refuse to fill the second time opening the menu.
Creator of Soul Saga.
http://www.disastercake.com

Disastercake

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 87
  • www.disastercake.com
    • View Profile
    • Disastercake
Re: More Null Reference Issues
« Reply #2 on: March 21, 2013, 10:59:35 AM »
I wanted to mention I sent a project with this issue isolated to the support e-mail.
Creator of Soul Saga.
http://www.disastercake.com

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: More Null Reference Issues
« Reply #3 on: March 22, 2013, 02:09:04 AM »
Yup, thanks.

demid

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 11
    • View Profile
Re: More Null Reference Issues
« Reply #4 on: April 03, 2013, 01:02:35 PM »
I have a similar issue with exactly the same stack trace. In the editor everything works just fine, but when I install the project on an Android device it works strange - UI sprites under a panel throwing the same exception are not hiding when I try to hide them. Corresponding game objects and sprites are disabled and deactivated but this does not affect the visual content of the screen.

This behaviour is reproduced with Unity 4.1.2 + NGUI 2.5.1.

ArenMook, please keep this thread up to date because currently I don't have a workaround for this issue.

Quakeulf

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 8
    • View Profile
Re: More Null Reference Issues
« Reply #5 on: May 04, 2013, 11:28:21 AM »
I also do not have a workaround to this. Please help. :'(

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: More Null Reference Issues
« Reply #6 on: May 04, 2013, 07:35:35 PM »
It was one of the fixes in 2.6.0 as I recall. You'll see it as soon as the latest (2.6.1) goes from Pro to Standard.

Quakeulf

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 8
    • View Profile
Re: More Null Reference Issues
« Reply #7 on: May 05, 2013, 12:49:12 PM »
Thank you for your response, but where is 2.6.* available from? My team can't find it.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: More Null Reference Issues
« Reply #8 on: May 05, 2013, 12:58:45 PM »
It's pro-only for now. It should be out on the Asset Store soon-ish.

Quakeulf

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 8
    • View Profile
Re: More Null Reference Issues
« Reply #9 on: May 07, 2013, 08:10:22 AM »
Thank you for your reply. This is currently the biggest issue for my game now. We cannot launch in its current state. I will be awaiting the update, then. Please let us know when it hits. :3

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: More Null Reference Issues
« Reply #10 on: May 07, 2013, 04:20:55 PM »
It already has.