Search Unity

Bug Processor issue in pre.8 and pre.9

Discussion in 'Netcode for GameObjects' started by jeffwilcke, May 11, 2022.

  1. jeffwilcke

    jeffwilcke

    Joined:
    Apr 8, 2013
    Posts:
    6
    Hello. Since I've upgraded from 1.0.0-pre.7 to pre.9 I'm getting the following generator errors (same happens with pre.8):


    (0,0): error - System.NullReferenceException: Object reference not set to an instance of an object.| at
    Unity.Netcode.Editor.CodeGen.INetworkSerializableILPP.Process(ICompiledAssembly compiledAssembly) in

    Library/PackageCache/com.unity.netcode.gameobjects@1.0.0-pre.9/Editor/CodeGen/INetworkSerializableILPP.cs:line 116 at

    Unity.Netcode.Editor.CodeGen.INetworkSerializableILPP.Process(ICompiledAssembly compiledAssembly) in

    Library/PackageCache/com.unity.netcode.gameobjects@1.0.0 pre.9/Editor/CodeGen/INetworkSerializableILPP.cs:line 116


    Any advice?
     
  2. AaronKB

    AaronKB

    Joined:
    Aug 16, 2019
    Posts:
    27
    Hi, did you find a solution to this? I just started getting this today too - I have added a new object for serialisation and there are generics involved so I'm wondering if there's an issue there.

    This minimal code below causes the error. If I comment out T data (Making the class useless of course) then it's fine.

    Code (CSharp):
    1. public class PrivateClientData<T> : NetworkBehaviour where T : INetworkSerializable, IEquatable<T>
    2. {
    3.         T data;
    4. }
    Thanks
     
    Last edited: May 22, 2022
  3. jeffwilcke

    jeffwilcke

    Joined:
    Apr 8, 2013
    Posts:
    6
    Late reply, sorry for that.

    I did sort of worked around the issue by changing the code in
    Library/PackageCache/com.unity.netcode.gameobjects@1.0.0-pre.9/Editor/CodeGen/INetworkSerializableILPP.cs
    . I added a
    ?
    after
    Resolve()
    .

    I wish someone from Unity would actually look in to this
     
    remzisch likes this.
  4. viknesh2020

    viknesh2020

    Joined:
    Jul 19, 2016
    Posts:
    52
    Didn't solve my issue. When I edit the script to add ?, it get automatically undone after I save.
     
  5. jeffwilcke

    jeffwilcke

    Joined:
    Apr 8, 2013
    Posts:
    6
    Make sure you open the file through Unity and not explorer/finder. I think you're editing the cache, which gets overwritten
     
  6. viknesh2020

    viknesh2020

    Joined:
    Jul 19, 2016
    Posts:
    52
    I opened the script from Project tab inside Unity. Is there anything that I am missing?
     
  7. AaronKB

    AaronKB

    Joined:
    Aug 16, 2019
    Posts:
    27
    Thanks for the reply - I abandoned this completely but good to see you found a solution. I wish there was more action on Unity's part for these sorts of things. I'm getting a NetworkList sync issue now (Not syncing to standalone clients).....
     
  8. jesseo_unity

    jesseo_unity

    Unity Technologies

    Joined:
    Jun 26, 2018
    Posts:
    2
    This issue (a null reference in the ILPP code when creating a generic inheriting from NetworkBehavior) is fixed in 1.0.0-pre.10 which is available now. Please update and give it a try.

    As for the NetworkList sync issues mentioned by AaronKB, this is being tracked in github and we're looking for someone who can provide a minimal repro as we cannot reproduce this internally.