Guard against blank username.

- Do not try to log failure or apply history when username is blank.