Fix null check causing teleport to exit early in some conditions