From e79d3bc3b7070404e090036d1bd4e28d4bed54ca Mon Sep 17 00:00:00 2001 From: Alexander Skvortsov Date: Sun, 12 Dec 2021 15:41:59 -0500 Subject: [PATCH] Don't assume `app.session.user` is present --- framework/core/js/src/forum/states/NotificationListState.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/framework/core/js/src/forum/states/NotificationListState.ts b/framework/core/js/src/forum/states/NotificationListState.ts index cfe214c02..75bb07158 100644 --- a/framework/core/js/src/forum/states/NotificationListState.ts +++ b/framework/core/js/src/forum/states/NotificationListState.ts @@ -15,7 +15,7 @@ export default class NotificationListState extends PaginatedListState { - if (app.session.user.newNotificationCount()) { + if (app.session.user?.newNotificationCount()) { this.pages = []; this.location = { page: 1 }; } @@ -24,7 +24,7 @@ export default class NotificationListState extends PaginatedListState { page.items.forEach((notification) => notification.pushAttributes({ isRead: true }));