Skip to content

Commit 007ad36

Browse files
authored
fix: Fixes an ILPP crash when a NetworkBehaviour had a field of a type with no base type (an interface or object) (#1914)
1 parent 38a1510 commit 007ad36

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

com.unity.netcode.gameobjects/Editor/CodeGen/INetworkSerializableILPP.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,10 @@ public override ILPostProcessResult Process(ICompiledAssembly compiledAssembly)
114114
// Get the field type and its base type
115115
var fieldType = field.FieldType;
116116
var baseType = fieldType.Resolve().BaseType;
117+
if (baseType == null)
118+
{
119+
continue;
120+
}
117121
// This type stack is used for resolving NetworkVariableSerialization's T value
118122
// When looking at base types, we get the type definition rather than the
119123
// type reference... which means that we get the generic definition with an

0 commit comments

Comments
 (0)