Added a null check for the player to prevent exception on new players.