Avoid NPE for fringe cases

This change avoids an NPE that can occur in the rare case when thePlayer is not null, but theWorld is.