Skip to content

Commit

Permalink
Fix not returning null (ExMod-Team#22)
Browse files Browse the repository at this point in the history
* Fix not returning null

* Apply suggestions from code review

Co-authored-by: Jesus QC <69375249+Jesus-QC@users.noreply.github.com>

* Little modification

---------

Co-authored-by: Jesus QC <69375249+Jesus-QC@users.noreply.github.com>
  • Loading branch information
louis1706 and Jesus-QC authored Aug 4, 2024
1 parent 81c3652 commit 1f2d209
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions EXILED/Exiled.API/Features/Player.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1266,8 +1266,13 @@ public static Player Get(GameObject gameObject)
if (Dictionary.TryGetValue(gameObject, out Player player))
return player;

UnverifiedPlayers.TryGetValue(gameObject, out player);
return player;
if (UnverifiedPlayers.TryGetValue(gameObject, out player))
return player;

if (ReferenceHub.TryGetHub(gameObject, out ReferenceHub hub))
return new(hub);

return null;
}

/// <summary>
Expand Down

0 comments on commit 1f2d209

Please sign in to comment.