From 97f581e1dfed65f0db0c5b4350626ac9d0f3d982 Mon Sep 17 00:00:00 2001 From: Sam Saffron Date: Wed, 15 Jul 2020 11:38:28 +1000 Subject: [PATCH] FIX: add protection just in case topic is not set Under some conditions we may be loading the composer with no topic set. This code could fail leading to a broken composer. --- .../javascripts/select-kit/addon/components/composer-actions.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/assets/javascripts/select-kit/addon/components/composer-actions.js b/app/assets/javascripts/select-kit/addon/components/composer-actions.js index c245698de2c..287b75227ae 100644 --- a/app/assets/javascripts/select-kit/addon/components/composer-actions.js +++ b/app/assets/javascripts/select-kit/addon/components/composer-actions.js @@ -91,7 +91,9 @@ export default DropdownSelectBoxComponent.extend({ if ( this.action === REPLY && + this.topic && this.topic.isPrivateMessage && + this.topic.details && (this.topic.details.allowed_users.length > 1 || this.topic.details.allowed_groups.length > 0) && !this.isEditing &&