Problem/Motivation
When a user entity is created with a username set, but no email, the presave hook overwrites the username to an empty value, because no email is set.
Proposed resolution
Only set the username to the email address, if an email is actually set.
Comments
Comment #3
chfoidl commented