Skip to content

NullReferenceException while building a project #1378

Description

@marek-stoj

Describe the bug
Getting the following exception (in Editor.log) when building one of our projects after only importing the Netcode package. A minimal, new Unity project with just the package imported works fine though.

(0,0): error System.NullReferenceException: Object reference not set to an instance of an object
at Unity.Netcode.Editor.CodeGen.NetworkBehaviourILPP.ImportReferences (Mono.Cecil.ModuleDefinition moduleDefinition) [0x0069e] in <1d1144dabdc047fba7e8e2c6b3bfbaa5>:0
at Unity.Netcode.Editor.CodeGen.NetworkBehaviourILPP.Process (Unity.CompilationPipeline.Common.ILPostProcessing.ICompiledAssembly compiledAssembly) [0x000a1] in <1d1144dabdc047fba7e8e2c6b3bfbaa5>:0
at ILPostProcessorRunner.RunILPostProcessors (NamedILPostProcessorWrapper[] ilpostProcessors) [0x00073] in <04671920fa244b7da7c644c861e4f88f>:0
at ILPostProcessorRunner.Main (System.String[] args) [0x000be] in <04671920fa244b7da7c644c861e4f88f>:0

Screenshots
image

Environment (please complete the following information):

  • OS: Windows 10
  • Unity Version: 2020.3.13f1
  • Netcode Version: 1.0.0-pre2
  • Netcode Commit: ?

I've already tried investigating the issue but I couldn't get the Debugger to enter the ImportReferences() method. And there are many places in that method where we could get an NRE 😉

Any help would be greatly appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions