diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2016-04-18 20:39:29 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2016-04-18 20:39:29 +0200 |
commit | 21b97d53a067aedfbc18f74cfa200d3bb348aa52 (patch) | |
tree | 6b7f2e994a5ab2ec439a0d576d173363125eff55 /js | |
parent | 129b1aa4bd5f7e8b760be5685654f5886c8cfe5f (diff) |
Load valid contact in case an invalid uid is entered in the url
Diffstat (limited to 'js')
-rw-r--r-- | js/components/contactDetails/contactDetails_controller.js | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/js/components/contactDetails/contactDetails_controller.js b/js/components/contactDetails/contactDetails_controller.js index 6c14ef34..fb3df82a 100644 --- a/js/components/contactDetails/contactDetails_controller.js +++ b/js/components/contactDetails/contactDetails_controller.js @@ -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; |