Error is set, even if there is none

to avoid displaying the error alert with no error, this checks if we have one (see login controller)