Add null check before attempting to unload a world.