From 1bb6a35d8c19948308467eb1c7aceafaf634fb39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Fri, 4 Jan 2019 14:23:02 +0100 Subject: [PATCH] MOBILE-2795 comments: Fix uncaught exception --- src/core/comments/pages/viewer/viewer.ts | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/core/comments/pages/viewer/viewer.ts b/src/core/comments/pages/viewer/viewer.ts index 1ce7872a1..6652b879b 100644 --- a/src/core/comments/pages/viewer/viewer.ts +++ b/src/core/comments/pages/viewer/viewer.ts @@ -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') { - this.domUtils.showAlertTranslated('core.notice', 'core.commentsnotworking'); - } else { - this.domUtils.showErrorModal(error); - } + if (error && this.component == 'assignsubmission_comments') { + this.domUtils.showAlertTranslated('core.notice', 'core.commentsnotworking'); } else { - this.domUtils.showErrorModal(this.translate.instant('core.error') + ': get_comments'); + this.domUtils.showErrorModalDefault(error, this.translate.instant('core.error') + ': get_comments'); } - - return Promise.reject(null); }); }