Handle error when the device id mismatch

This commit is contained in:
Gustavo Maximiliano Cortez 2015-10-28 16:19:16 -03:00
commit ca7ec8e392
No known key found for this signature in database
GPG key ID: 15EDAD8D9F2EB1AF
3 changed files with 18 additions and 9 deletions

View file

@ -515,10 +515,10 @@ angular
// Try to open local profile
profileService.loadAndBindProfile(function(err) {
if (err) {
if (err.message.match('NOPROFILE')) {
if (err.message && err.message.match('NOPROFILE')) {
$log.debug('No profile... redirecting');
$state.transitionTo('splash');
} else if (err.message.match('NONAGREEDDISCLAIMER')) {
} else if (err.message && err.message.match('NONAGREEDDISCLAIMER')) {
$log.debug('Display disclaimer... redirecting');
$state.transitionTo('disclaimer');
} else {
@ -545,4 +545,4 @@ angular
}, 50);
}
});
});
});