fix(update-user.js): add another existence check
This commit is contained in:
parent
0eb7612cbb
commit
f049ddefde
1 changed files with 2 additions and 2 deletions
|
@ -50,7 +50,7 @@
|
||||||
$scope.state = 'updating';
|
$scope.state = 'updating';
|
||||||
ApiService.changeUserDetails(data).then(function() {
|
ApiService.changeUserDetails(data).then(function() {
|
||||||
UserService.load(function(updated) {
|
UserService.load(function(updated) {
|
||||||
if (updated.prompts.length) {
|
if (updated && updated.prompts && updated.prompts.length) {
|
||||||
$scope.state = 'editing';
|
$scope.state = 'editing';
|
||||||
} else {
|
} else {
|
||||||
$location.url('/');
|
$location.url('/');
|
||||||
|
@ -82,4 +82,4 @@
|
||||||
confirmUsername(username);
|
confirmUsername(username);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
|
|
Reference in a new issue