From 44e650d175d153860362d607e55ebd3b269cf684 Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Tue, 9 May 2023 23:52:46 +0200 Subject: [PATCH] FIX: prevents fast channel switching to cause an error (#21461) `this.users` would end up being nil and `this.users.filter` would generate an exception. --- .../javascripts/discourse/components/chat-replying-indicator.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/chat/assets/javascripts/discourse/components/chat-replying-indicator.js b/plugins/chat/assets/javascripts/discourse/components/chat-replying-indicator.js index cfd21404eae..056c1c64a3a 100644 --- a/plugins/chat/assets/javascripts/discourse/components/chat-replying-indicator.js +++ b/plugins/chat/assets/javascripts/discourse/components/chat-replying-indicator.js @@ -22,7 +22,7 @@ export default class ChatReplyingIndicator extends Component { async subscribe() { this.presenceChannel = this.presence.getChannel(this.channelName); await this.presenceChannel.subscribe(); - this.users = this.presenceChannel.users; + this.users = this.presenceChannel.users || []; this.presenceChannel.on("change", this.handlePresenceChange); }