Commit 3d5e7491 authored by Dan Beam's avatar Dan Beam Committed by Commit Bot

Extensions: fix console error when removing from detail view

crisper.js:formatted:6217 Uncaught TypeError: Cannot read property 'getDetailsButton' of null
    at HTMLElement.getDetailsButton (crisper.js:formatted:6217)
    at HTMLElement.onViewExitFinish_ (crisper.js:formatted:8074)
    at HTMLElement.handler (polymer-extracted.js:11)
    at crisper.js:formatted:2132
    at async Promise.all (chrome://extensions/index 0)

I'm fairly sure this was caused in https://crrev.com/c/1125507

Unfortunately, CrExtensionsManagerUnitTest.UninstallFromDetails is flaky
and currently DISABLED_ (I re-enabled it locally and it didn't fail).
Bummer.

R=rbpotter@chromium.org
BUG=none

Change-Id: Ic390a4ee61d61832f9aee96ca5d9a2f2d9310c40
Reviewed-on: https://chromium-review.googlesource.com/c/1437949
Commit-Queue: Dan Beam (slow until 1/29) <dbeam@chromium.org>
Commit-Queue: Rebekah Potter <rbpotter@chromium.org>
Auto-Submit: Dan Beam (slow until 1/29) <dbeam@chromium.org>
Reviewed-by: default avatarRebekah Potter <rbpotter@chromium.org>
Cr-Commit-Position: refs/heads/master@{#626322}
parent ae899993
......@@ -52,7 +52,8 @@ cr.define('extensions', function() {
* @return {?Element}
*/
getDetailsButton: function(id) {
return this.$$(`#${id}`).getDetailsButton();
const item = this.$$(`#${id}`);
return item && item.getDetailsButton();
},
/**
......@@ -60,7 +61,8 @@ cr.define('extensions', function() {
* @return {?Element}
*/
getErrorsButton: function(id) {
return this.$$(`#${id}`).getErrorsButton();
const item = this.$$(`#${id}`);
return item && item.getErrorsButton();
},
/**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment