You're right. I think it's just the second if (name == null) that needs to be removed.