Bug 1358229 Fix exception during optional permission prompts draft
authorAndrew Swan <aswan@mozilla.com>
Mon, 24 Apr 2017 10:44:41 -0700
changeset 567274 f7baed8d296595552256c5f0edb50326b7f86442
parent 567252 62a2d3693579fc77b1c510984ae471a860d03302
child 625587 a1f98b6b51b4761ad637b1d775a2617da0705042
push id55509
push useraswan@mozilla.com
push dateMon, 24 Apr 2017 17:45:03 +0000
bugs1358229
milestone55.0a1
Bug 1358229 Fix exception during optional permission prompts MozReview-Commit-ID: 5e3tlFF7uvp
browser/modules/ExtensionsUI.jsm
--- a/browser/modules/ExtensionsUI.jsm
+++ b/browser/modules/ExtensionsUI.jsm
@@ -393,26 +393,30 @@ this.ExtensionsUI = {
     };
 
     let win = browser.ownerGlobal;
     return new Promise(resolve => {
       let action = {
         label: strings.acceptText,
         accessKey: strings.acceptKey,
         callback: () => {
-          this.histogram.add(histkey + "Accepted");
+          if (histkey) {
+            this.histogram.add(histkey + "Accepted");
+          }
           resolve(true);
         },
       };
       let secondaryActions = [
         {
           label: strings.cancelText,
           accessKey: strings.cancelKey,
           callback: () => {
-            this.histogram.add(histkey + "Rejected");
+            if (histkey) {
+              this.histogram.add(histkey + "Rejected");
+            }
             resolve(false);
           },
         },
       ];
 
       // Get the text value of strings.header to pre-populate the header. This will get
       // overwritten with the HTML version later.
       let escapeHeader = browser.ownerDocument.createElement("div");