Bug 1297674 - Don't access folder for a message opened from a file. r=mkmelin, a=jorgk
authorJorg K <jorgk@jorgk.com>
Fri, 26 Aug 2016 00:16:09 -0500
changeset 27449 95c294c874f932d3f9cdb4f1c113bfc9233d9f55
parent 27448 9ee09fdd13c581e642697aeabbb5fc17ca82cdbe
child 27450 55291c180572457e1d38468afd83721cc3e3d840
push id1850
push userclokep@gmail.com
push dateWed, 08 Mar 2017 19:29:12 +0000
treeherdercomm-esr52@028df196b2d9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmkmelin, jorgk
bugs1297674
Bug 1297674 - Don't access folder for a message opened from a file. r=mkmelin, a=jorgk
mail/base/content/mailWindowOverlay.js
--- a/mail/base/content/mailWindowOverlay.js
+++ b/mail/base/content/mailWindowOverlay.js
@@ -567,17 +567,18 @@ function InitAppMessageMenu()
 
 /**
  * Hides the "Edit Draft Message" menuitems for messages which are not in a draft folder.
  */
 function updateHiddenStateForEditDraftMsgCmd()
 {
   let msg = gFolderDisplay.selectedMessage;
   let folder = gFolderDisplay.displayedFolder;
-  let inDraftFolder = (msg &&
+  let inDraftFolder = (msg && msg.folder &&  // Need to check folder since messages
+                                             // opened from file have none.
                        msg.folder.isSpecialFolder(nsMsgFolderFlags.Drafts, true)) ||
                       (folder && folder.getFlag(nsMsgFolderFlags.Drafts));
   document.getElementById("cmd_editDraftMsg").setAttribute("hidden", !inDraftFolder);
 }
 
 /**
  * Initializes the menu item aMenuItem to show either "Move" or "Copy" to
  * folder again, based on the value of mail.last_msg_movecopy_target_uri.