Avoid NPE on null password

A detailed description of the issue can be found here https://issues.jboss.org/browse/AEROGEAR-1004