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:11 -0500
changeset 27353 bf311c97af593b02f42ccacb6711aee68aa7ae96
parent 27350 2b29b68058eab4a5f0b3b1acc916a47608f7c358
child 27354 118cbdfa701ff8f0fd98c4fa25d13c14296cbd1e
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
@@ -566,17 +566,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.