Fix NPE when setting a player's spectator target
Mojang asked me to make some changes, so applied them here.