Load valid contact in case an invalid uid is entered in the url

This commit is contained in:
Thomas Müller 2016-04-18 20:39:29 +02:00
parent 129b1aa4bd
commit 21b97d53a0
No known key found for this signature in database
GPG Key ID: A943788A3BBEC44C
1 changed files with 4 additions and 0 deletions

View File

@ -51,6 +51,10 @@ angular.module('contactsApp')
return;
}
ContactService.getById(uid).then(function(contact) {
if (angular.isUndefined(contact)) {
ctrl.clearContact();
return;
}
ctrl.contact = contact;
ctrl.photo = ctrl.contact.photo();
ctrl.show = true;