Bug 1519465 - Don't access non-existent tabmail when building context menu for a stand-alone message window. r=jorgk
authoraceman <acelists@atlas.sk>
Sat, 12 Jan 2019 15:32:00 +0100
changeset 33324 4f89930a06e5
parent 33323 253562a57fb5
child 33325 28b72562d11e
push id2368
push userclokep@gmail.com
push dateMon, 28 Jan 2019 21:12:50 +0000
treeherdercomm-beta@56d23c07d815 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjorgk
bugs1519465
Bug 1519465 - Don't access non-existent tabmail when building context menu for a stand-alone message window. r=jorgk
mail/base/content/nsContextMenu.js
--- a/mail/base/content/nsContextMenu.js
+++ b/mail/base/content/nsContextMenu.js
@@ -81,17 +81,18 @@ nsContextMenu.prototype = {
 
     this.hasPageMenu = false;
     if (!aIsShift) {
       this.hasPageMenu = PageMenuParent.buildAndAddToPopup(this.target,
                                                            aPopup);
 
       let subject = {
         menu: aPopup,
-        tab: document.getElementById("tabmail").currentTabInfo,
+        tab: document.getElementById("tabmail") ?
+             document.getElementById("tabmail").currentTabInfo : undefined,
         isContentSelected: this.isContentSelected,
         inFrame: this.inFrame,
         isTextSelected: this.isTextSelected,
         onTextInput: this.onTextInput,
         onLink: this.onLink,
         onImage: this.onImage,
         onVideo: this.onVideo,
         onAudio: this.onAudio,