Use instanceof instead of null check with isPlayer()