From c25d1ea8e77f7e9df40bc6bd1cde54f459ba2a92 Mon Sep 17 00:00:00 2001 From: Keegan McAllister Date: Thu, 29 Nov 2012 14:42:19 -0500 Subject: [PATCH] Guard against incorrect use of compose.set_mode (imported from commit 294441f2b9107ce2488866764c3d30c35133a14a) --- zephyr/static/js/compose.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/zephyr/static/js/compose.js b/zephyr/static/js/compose.js index 4be5be8627..787167221d 100644 --- a/zephyr/static/js/compose.js +++ b/zephyr/static/js/compose.js @@ -153,6 +153,9 @@ exports.clear = function () { // Set the mode of a compose already in progress. // Does not clear the input fields. exports.set_mode = function (mode) { + if (!is_composing_message) + return; + if (mode === 'private') { show('private', $("#private_message_recipient")); is_composing_message = "private";