Skip to content

Commit 4c2259f

Browse files
authored
fix: Fix NullReferenceException in CodeGen (#2581)
* fix: Fix NullReferenceException in CodeGen Credit to @andreyshade * Changelog
1 parent e696fa8 commit 4c2259f

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

com.unity.netcode.gameobjects/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Additional documentation and release notes are available at [Multiplayer Documen
1717

1818
### Fixed
1919

20+
- Fixed: Fixed a null reference in codegen in some projects (#2581)
2021
- Fixed issue where the `OnClientDisconnected` client identifier was incorrect after a pending client connection was denied. (#2569)
2122
- Fixed warning "Runtime Network Prefabs was not empty at initialization time." being erroneously logged when no runtime network prefabs had been added (#2565)
2223
- Fixed issue where some temporary debug console logging was left in a merged PR. (#2562)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ public static MethodReference MakeGeneric(this MethodReference self, params Type
155155
public static bool IsSubclassOf(this TypeReference typeReference, TypeReference baseClass)
156156
{
157157
var type = typeReference.Resolve();
158-
if (type.BaseType == null || type.BaseType.Name == nameof(Object))
158+
if (type?.BaseType == null || type.BaseType.Name == nameof(Object))
159159
{
160160
return false;
161161
}

0 commit comments

Comments
 (0)