Extract isNullOrEmpty() to reuse in other if clause.