Fix crash adding account

This commit fixes following bug for me: https://mirakel.atlassian.net/browse/DAV-17?jql=project%20%3D%20DAV