Bug 1380575 - Fix aListItem is undefined when uninstalling from Androud about:addons page. r=mixedpuppy
authorLuca Greco <lgreco@mozilla.com>
Fri, 28 Jul 2017 14:56:18 +0200
changeset 423094 8f349f00f6668cfe6f619f32c108b69b2bc929a2
parent 423093 69245ffa6a000020f88d15d915d155bc223777ae
child 423095 dac5b6d11df70c3a672e1883db027ad87c76d418
push id1517
push userjlorenzo@mozilla.com
push dateThu, 14 Sep 2017 16:50:54 +0000
treeherdermozilla-release@3b41fd564418 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmixedpuppy
bugs1380575
milestone56.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1380575 - Fix aListItem is undefined when uninstalling from Androud about:addons page. r=mixedpuppy MozReview-Commit-ID: HrJ17Tu81Hm
mobile/android/chrome/content/aboutAddons.js
--- a/mobile/android/chrome/content/aboutAddons.js
+++ b/mobile/android/chrome/content/aboutAddons.js
@@ -117,17 +117,23 @@ function openLink(url) {
   let BrowserApp = gChromeWin.BrowserApp;
   BrowserApp.addTab(url, { selected: true, parentId: BrowserApp.selectedTab.id });
 }
 
 function onPopState(aEvent) {
   // Called when back/forward is used to change the state of the page
   if (aEvent.state) {
     // Show the detail page for an addon
-    Addons.showDetails(Addons._getElementForAddon(aEvent.state.id));
+    const listItem = Addons._getElementForAddon(aEvent.state.id);
+    if (listItem) {
+      Addons.showDetails(listItem);
+    } else {
+      // If the addon doesn't exist anymore, go back in the history.
+      history.back();
+    }
   } else {
     // Clear any previous detail addon
     let detailItem = document.querySelector("#addons-details > .addon-item");
     detailItem.addon = null;
 
     showAddons();
   }
 }