Author Topic: UIPopupList error message  (Read 1602 times)

capitalj

  • Jr. Member
  • **
  • Thank You
  • -Given: 5
  • -Receive: 0
  • Posts: 88
    • View Profile
UIPopupList error message
« on: July 09, 2014, 07:09:39 PM »
Hi,

Sometimes I get this error:
NullReferenceException: Object reference not set to an instance of an object
UIPopupList.GetHighlightPosition () (at Assets/NGUI/Scripts/Interaction/UIPopupList.cs:447)
UIPopupList+<UpdateTweenPosition>c__Iterator2B.MoveNext () (at Assets/NGUI/Scripts/Interaction/UIPopupList.cs:472)

when I open a uipopuplist. It doesn't seem to cause any problems as the correct item is selected and it all looks fine, but just wanted to report it anyways. I can't seem to find a reliable way to repro it as the same popup will work without the error most of the time.

-JJ

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIPopupList error message
« Reply #1 on: July 10, 2014, 08:13:27 PM »
Sounds like the "mHighlight" is null at that point. Curious, but can be avoided with a null check:
  1. if (mHighlightedLabel == null || mHighlight == null) return Vector3.zero;