Skip to content

Commit

Permalink
fix: revert removed sendResponse(error) on thenable result rejection …
Browse files Browse the repository at this point in the history
…(at least for now) and handle sendResponsePromise rejections.
  • Loading branch information
rpl committed Mar 26, 2018
1 parent 9eace50 commit 87e76c5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/browser-polyfill.js
Original file line number Diff line number Diff line change
Expand Up @@ -388,9 +388,13 @@ if (typeof browser === "undefined") {
if (isResultThenable) {
result.then(sendResponse, error => {
console.error(error);
sendResponse(null);
});
} else {
sendResponsePromise.then(sendResponse);
sendResponsePromise.then(sendResponse, error => {
console.error(error);
sendResponse(null);
});
}

// Let Chrome know that the listener is replying.
Expand Down

0 comments on commit 87e76c5

Please sign in to comment.