Skip to content

Commit f94b1a3

Browse files
committed
MOBILE-2919 message: Fix error when auto-open discussion
1 parent 8b2ed81 commit f94b1a3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/addon/messages/components/discussions/discussions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export class AddonMessagesDiscussionsComponent implements OnDestroy {
6262

6363
// Update discussions when new message is received.
6464
this.newMessagesObserver = eventsProvider.on(AddonMessagesProvider.NEW_MESSAGE_EVENT, (data) => {
65-
if (data.userId) {
65+
if (data.userId && this.discussions) {
6666
const discussion = this.discussions.find((disc) => {
6767
return disc.message.user == data.userId;
6868
});
@@ -82,7 +82,7 @@ export class AddonMessagesDiscussionsComponent implements OnDestroy {
8282

8383
// Update discussions when a message is read.
8484
this.readChangedObserver = eventsProvider.on(AddonMessagesProvider.READ_CHANGED_EVENT, (data) => {
85-
if (data.userId) {
85+
if (data.userId && this.discussions) {
8686
const discussion = this.discussions.find((disc) => {
8787
return disc.message.user == data.userId;
8888
});

0 commit comments

Comments
 (0)