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 34178 4f89930a06e5498262678701c295b367d76c2e83
parent 34177 253562a57fb51b675a5f7eaf163b0a1ee0f06cd8
child 34179 28b72562d11e4298360d04a7374a4c1067cd8a16
push id389
push userclokep@gmail.com
push dateMon, 18 Mar 2019 19:01:53 +0000
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,