Obscure null reference exception without project context
See original GitHub issueI get this exception in some condition I can’t fully isolate. Once this throws, it starts throwing every single update/tick. After throwing in play mode, it even starts throwing outside of play mode during layout repaint. There is no reference to any of my own scripts. Can someone from the developers take a look?
NullReferenceException: Object reference not set to an instance of an object
Unity.Netcode.FastBufferWriter.get_Length () (at ./Library/PackageCache/com.unity.netcode.gameobjects@1.4.0/Runtime/Serialization/FastBufferWriter.cs:69)
Unity.Netcode.MessagingSystem.ProcessSendQueues () (at ./Library/PackageCache/com.unity.netcode.gameobjects@1.4.0/Runtime/Messaging/MessagingSystem.cs:786)
Unity.Netcode.NetworkManager.OnNetworkPostLateUpdate () (at ./Library/PackageCache/com.unity.netcode.gameobjects@1.4.0/Runtime/Core/NetworkManager.cs:1488)
Unity.Netcode.NetworkManager.NetworkUpdate (Unity.Netcode.NetworkUpdateStage updateStage) (at ./Library/PackageCache/com.unity.netcode.gameobjects@1.4.0/Runtime/Core/NetworkManager.cs:1381)
Unity.Netcode.NetworkUpdateLoop.RunNetworkUpdateStage (Unity.Netcode.NetworkUpdateStage updateStage) (at ./Library/PackageCache/com.unity.netcode.gameobjects@1.4.0/Runtime/Core/NetworkUpdateLoop.cs:185)
Unity.Netcode.NetworkUpdateLoop+NetworkPostLateUpdate+<>c.<CreateLoopSystem>b__0_0 () (at ./Library/PackageCache/com.unity.netcode.gameobjects@1.4.0/Runtime/Core/NetworkUpdateLoop.cs:268)
Reference from the last stack element: https://github.com/Unity-Technologies/com.unity.netcode.gameobjects/blob/54666c3454a3a5468bca0e1575a0b3059653c64e/com.unity.netcode.gameobjects/Runtime/Serialization/FastBufferWriter.cs#L69
I do not have experience with unsafe code, so I can’t really reverse engineer the problem.
Issue Analytics
- State:
- Created 2 months ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
c# - What is a NullReferenceException, and how do I fix it?
Since the problem is an object reference which is Nothing , the answer is to examine them to find out which one. Then...
Read more >How to Stop NullReferenceExceptions in .NET
This article gives you a toolset for stopping NullReferenceExceptions in .NET code. The article centers around Nullable Reference Types ...
Read more >Completely devoid of details · Issue #3858 · dotnet/runtime ...
The way i think of this is trying to infer context from identifiers than the methods. Identifiers tell you what is null, but...
Read more >Null reference exception in the console: Can you see ...
When I get a null reference exception, is there anyway to see which reference exactly is null? console just shows me the line,...
Read more >Null Reference Exceptions
Null Reference Exceptions. A NullReferenceException happens when you try to access a reference variable that isn't referencing any object.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@NoelStephensUnity
Since updating to v1.5.1 the issue doesn’t seem to appear anymore. I haven’t done anything too different, so I still can’t confirm what was the exact cause. I’ll make sure to reopen if the issue appears again.
I wish I could. I would’ve honestly tried to solve the problem on my own if it was consistent.
It rarely happens if I connect a client to the server, load a scene, then quickly disconnect them. Though none of that info is very helpful at all.
I am not sure if I can even reproduce the issue in a fresh project, as again, if I could I would’ve probably resolved it.
With all respect, I do not wish to send my entire project to Unity, especially using the bug reporter (sends a lot of unnecessary data about my running processes). If you can’t assist me further that’s totally fine. Thank you for your time.
I will try doing that and monitor if it fixes it.