From bef1966ca5e30ed6511214ab21ddf6a4c7b4e84a Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Thu, 22 Dec 2022 03:39:53 +0100 Subject: [PATCH] FIX: prevents creating a null User object (#19569) Following the removal of user in current_user_membership we were now doing: `User.create(null)`. I don't think it has any impact but this is just wasteful and could lead to issues if used. --- .../discourse/models/user-chat-channel-membership.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/chat/assets/javascripts/discourse/models/user-chat-channel-membership.js b/plugins/chat/assets/javascripts/discourse/models/user-chat-channel-membership.js index 7013a0533c..84a7d55cf9 100644 --- a/plugins/chat/assets/javascripts/discourse/models/user-chat-channel-membership.js +++ b/plugins/chat/assets/javascripts/discourse/models/user-chat-channel-membership.js @@ -19,7 +19,7 @@ UserChatChannelMembership.reopenClass({ }, _initUser(args) { - if (args.user instanceof User) { + if (!args.user || args.user instanceof User) { return; }