null-ref in Cutscene.OnValidate under certain circumstances

Forums 💬 NodeCanvas ⚙️ Support null-ref in Cutscene.OnValidate under certain circumstances

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #16573
    sugoidev
    Participant

      Under certain circumstances, we’ll get a null-ref exception in the Validate() method on Cutscene.cs

      I noticed this when using Unity’s QuickSearch.

      It will use LoadAssetAtPath so it can ask Unity for a thumbnail for the given asset.

      Unity will fire the OnValidate which will cause the exception.

      For the time being, I just added a
      if (group == null) {
      continue;
      }

      like this
      public void Validate() {

      if ( groupsRoot.transform.parent != this.transform ) { groupsRoot.transform.parent = this.transform; }

      directables = new List();
      foreach ( IDirectable group in groups.AsEnumerable().Reverse() ) {
              if (group == null) {
                  continue;
              }

      Seems to have worked.

       

      I’m not sure why it would be null, but I confirmed by attaching a debugger and it was indeed null.

      I’m reporting here because this might be part of something bigger.

       

      I’m on the latest SLATE (1.9.4) and Unity 2019.3.0b4.

      #16577
      Gavalakis
      Keymaster

        Hey,

        Please post Slate things in the Slate forums! 🙂
        With that said, what exactly is the exception line thrown?

        Thanks.

        #16576
        sugoidev
        Participant

          Oh man, I can’t believe I messed up the forums.

          Sorry!

           

          >With that said, what exactly is the exception line thrown?

          It’s just a normal null-ref because group will be null.

          The exception itself will be triggered in this line (group is null)

                          foreach ( IDirectable track in group.children.Reverse() ) {

           

          Should I open a thread on the SLATE forums instead of continuing this one?

          #16575
          Gavalakis
          Keymaster

            Hi,

            Sorry for the late reply. I was able to reproduce this issue and is now fixed for the next version.
            Don’t worry about messing the forums 🙂

            #16574
            sugoidev
            Participant

              Thank you!

            Viewing 5 posts - 1 through 5 (of 5 total)
            • You must be logged in to reply to this topic.