Bug 507541 - Follow-up: cater for case where no message is displayed. r=me
authorJorg K <jorgk@jorgk.com>
Mon, 31 Jul 2017 00:02:21 +0200
changeset 28524 8530044d4d8cd0ca8344d7b7512f63a5197c77b0
parent 28523 d72296afe377924325621557c9cf1d765957e5d6
child 28525 171d13fd4ff6d0154e1b199974aa49fabdbd2af4
push id1986
push userclokep@gmail.com
push dateWed, 02 Aug 2017 14:43:31 +0000
treeherdercomm-beta@b51c9adf2c9e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme
bugs507541
Bug 507541 - Follow-up: cater for case where no message is displayed. r=me
mail/base/content/mailCommands.js
--- a/mail/base/content/mailCommands.js
+++ b/mail/base/content/mailCommands.js
@@ -183,17 +183,18 @@ function ComposeMessage(type, format, fo
       msgWindow.charsetOverride = false;
     }
     if (type == msgComposeType.Reply ||
         type == msgComposeType.ReplyAll ||
         type == msgComposeType.ReplyToSender ||
         type == msgComposeType.ReplyToGroup ||
         type == msgComposeType.ReplyToSenderAndGroup ||
         type == msgComposeType.ReplyToList) {
-      let displayKey = ("messageKey" in gMessageDisplay.displayedMessage) ?
+      let displayKey = (gMessageDisplay.displayedMessage &&
+                        "messageKey" in gMessageDisplay.displayedMessage) ?
         gMessageDisplay.displayedMessage.messageKey : null;
       if (msgKey != displayKey) {
         // Not replying to the displayed message, so remove the selection
         // in order not to quote from the wrong message.
         ignoreQuote = true;
       }
     }
   }