Bug 996669 - Assert panel exists in oninstall/onuninstall listeners. r=jdover
authorMargaret Leibovic <margaret.leibovic@gmail.com>
Fri, 25 Apr 2014 16:57:56 -0700
changeset 180265 52cb8e937d121932c294a700e527b60a81dce37f
parent 180264 09d2cda1bb7394e71f5cced549fd4e9ad341d1f2
child 180266 cf95a5315f6f80299e0e7bb571ec0fe1b4a84493
push id6520
push usermleibovic@mozilla.com
push dateFri, 25 Apr 2014 23:59:26 +0000
treeherderfx-team@52cb8e937d12 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjdover
bugs996669
milestone31.0a1
Bug 996669 - Assert panel exists in oninstall/onuninstall listeners. r=jdover
mobile/android/modules/Home.jsm
--- a/mobile/android/modules/Home.jsm
+++ b/mobile/android/modules/Home.jsm
@@ -233,27 +233,31 @@ let HomePanels = (function () {
         throw "Home.panels: Invalid onrefresh for panel.id = " + data.panelId
             + ", view.index = " + data.viewIndex;
       }
 
       view.onrefresh();
     },
 
     "HomePanels:Installed": function handlePanelsInstalled(id) {
+      _assertPanelExists(id);
+
       let options = _registeredPanels[id]();
       if (!options.oninstall) {
         return;
       }
       if (typeof options.oninstall !== "function") {
         throw "Home.panels: Invalid oninstall function: panel.id = " + this.id;
       }
       options.oninstall();
     },
 
     "HomePanels:Uninstalled": function handlePanelsUninstalled(id) {
+      _assertPanelExists(id);
+
       let options = _registeredPanels[id]();
       if (!options.onuninstall) {
         return;
       }
       if (typeof options.onuninstall !== "function") {
         throw "Home.panels: Invalid onuninstall function: panel.id = " + this.id;
       }
       options.onuninstall();