From 17227e9e5336e5eb2941b62c8b1b0623c60c3ed2 Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Fri, 3 Jun 2022 20:59:30 +0200 Subject: [PATCH] DEV: under specific conditions (like tests) presenceState can be null (#16990) --- app/assets/javascripts/discourse/app/services/presence.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/discourse/app/services/presence.js b/app/assets/javascripts/discourse/app/services/presence.js index 07569c08ce8..d0394aef89c 100644 --- a/app/assets/javascripts/discourse/app/services/presence.js +++ b/app/assets/javascripts/discourse/app/services/presence.js @@ -108,7 +108,7 @@ class PresenceChannel extends EmberObject { if (!this.subscribed) { return; } - return this._presenceState.users; + return this._presenceState?.users; } @computed("_presenceState.count", "subscribed") @@ -116,7 +116,7 @@ class PresenceChannel extends EmberObject { if (!this.subscribed) { return; } - return this._presenceState.count; + return this._presenceState?.count; } @computed("_presenceState.count", "subscribed") @@ -124,7 +124,7 @@ class PresenceChannel extends EmberObject { if (!this.subscribed) { return; } - return this._presenceState.countOnly; + return this._presenceState?.countOnly; } }