getUserByLogin: replace nulls by optionals.

It might prevent a bunch of NullPointerExceptions.