Bug 1380575 - Fix aListItem is undefined when uninstalling from Androud about:addons page. r=mixedpuppy

MozReview-Commit-ID: HrJ17Tu81Hm

--HG--
extra : rebase_source : 537f3280c55b10597a88087ee70b98fccfedc0a2
This commit is contained in:
Luca Greco 2017-07-28 14:56:18 +02:00
Родитель e3c2b4089a
Коммит dd6ab49bcd
1 изменённых файлов: 7 добавлений и 1 удалений

Просмотреть файл

@ -122,7 +122,13 @@ 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");