Processor issue in pre.8 and pre.9

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?

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.

public class PrivateClientData<T> : NetworkBehaviour where T : INetworkSerializable, IEquatable<T>
{
        T data;
}

Thanks

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

1 Like

Didn’t solve my issue. When I edit the script to add ?, it get automatically undone after I save.

Make sure you open the file through Unity and not explorer/finder. I think you’re editing the cache, which gets overwritten

I opened the script from Project tab inside Unity. Is there anything that I am missing?

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)…

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.