Skip to content

Commit 140233f

Browse files
authored
Add null checks in RegisterSidToTypeConnection
1 parent bf8109d commit 140233f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Celeste.Mod.mm/Mod/Registry/EntityRegistry.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ public static class EntityRegistry {
2727
public static IReadOnlySet<string> GetKnownSidsFromType(Type type) => TypeToSids.GetValueOrDefault(type) ?? EmptyStringSet;
2828

2929
internal static void RegisterSidToTypeConnection(string sid, Type type) {
30+
if (sid is null || type is null)
31+
return;
32+
3033
ref var sidToTypeEntry = ref CollectionsMarshal.GetValueRefOrAddDefault(SidToTypes, sid, out _);
3134
sidToTypeEntry ??= new(1);
3235
sidToTypeEntry.Add(type);
@@ -270,4 +273,4 @@ static EntityRegistry() {
270273
RegisterSidToTypeConnection("spawnFacingTrigger", typeof(SpawnFacingTrigger));
271274
RegisterSidToTypeConnection("detachFollowersTrigger", typeof(DetachStrawberryTrigger));
272275
}
273-
}
276+
}

0 commit comments

Comments
 (0)