Skip to content

Commit

Permalink
fix: fixing spawn prefab when handler is null
Browse files Browse the repository at this point in the history
if handler is null we should use the default spawning instead
  • Loading branch information
James-Frowen committed Oct 31, 2021
1 parent 0bb7327 commit eb0fd1c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Assets/Mirage/Runtime/ClientObjectManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ internal void OnSpawn(SpawnMessage msg)

NetworkIdentity SpawnPrefab(SpawnMessage msg)
{
if (spawnHandlers.TryGetValue(msg.prefabHash.Value, out SpawnHandlerDelegate handler))
if (spawnHandlers.TryGetValue(msg.prefabHash.Value, out SpawnHandlerDelegate handler) && handler != null)
{
NetworkIdentity obj = handler(msg);
if (obj == null)
Expand Down

0 comments on commit eb0fd1c

Please sign in to comment.