MOBILE-2795 comments: Fix uncaught exception

main
Pau Ferrer Ocaña 2019-01-04 14:23:02 +01:00
parent ab4941b8ac
commit 1bb6a35d8c
1 changed files with 5 additions and 9 deletions

View File

@ -78,20 +78,16 @@ export class CoreCommentsViewerPage {
// Get the user profile image.
this.userProvider.getProfile(comment.userid, undefined, true).then((user) => {
comment.profileimageurl = user.profileimageurl;
}).catch(() => {
// Ignore errors.
});
});
}).catch((error) => {
if (error) {
if (this.component == 'assignsubmission_comments') {
if (error && this.component == 'assignsubmission_comments') {
this.domUtils.showAlertTranslated('core.notice', 'core.commentsnotworking');
} else {
this.domUtils.showErrorModal(error);
this.domUtils.showErrorModalDefault(error, this.translate.instant('core.error') + ': get_comments');
}
} else {
this.domUtils.showErrorModal(this.translate.instant('core.error') + ': get_comments');
}
return Promise.reject(null);
});
}