Skip to content

Commit

Permalink
core: handle DOM.resolveNode errors (#5427)
Browse files Browse the repository at this point in the history
  • Loading branch information
webcarrot authored and patrickhulce committed Jun 5, 2018
1 parent 4826a77 commit 8f23052
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,14 @@ class EventListeners extends Gatherer {
promise = driver.sendCommand('DOM.resolveNode', {
nodeId: nodeIdOrObject,
objectGroup: 'event-listeners-gatherer', // populates event handler info.
}).then(result => result.object);
})
.then(result => result.object)
.catch(() => {
return {
objectId: null,
description: '',
};
});
}

return promise.then(obj => {
Expand Down
3 changes: 2 additions & 1 deletion lighthouse-core/lib/element.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ class Element {
return null;
}
return this.driver.getObjectProperty(resp.object.objectId, propName);
});
})
.catch(() => null);
}
}

Expand Down

0 comments on commit 8f23052

Please sign in to comment.