Guard against incorrect use of compose.set_mode

(imported from commit 294441f2b9107ce2488866764c3d30c35133a14a)
This commit is contained in:
Keegan McAllister 2012-11-29 14:42:19 -05:00
parent 1047bf49b4
commit c25d1ea8e7
1 changed files with 3 additions and 0 deletions

View File

@ -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";