Type a null-safe short-circuit check space to flip Type a null-safe short-circuit check Answer if (name != null && name.length() > 0) { Because && short-circuits, name.length() is only called when name != null is true — no NullPointerException.