Skip to content

Commit

Permalink
fix: undefined error issue tshaddix#269
Browse files Browse the repository at this point in the history
fix random freeze issue "Cannot read properties of undefined (reading 'error')"
  • Loading branch information
fredericrous authored Nov 5, 2021
1 parent 2a77acb commit 4ac96f5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/store/Store.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,14 @@ class Store {
portName: this.portName,
payload: data
}, null, (resp) => {
if (!resp) {
const error = chrome.runtime.lastError;
const bgErr = new Error(`${backgroundErrPrefix}${error}`);

reject(assignIn(bgErr, error));
return;
}

const {error, value} = resp;

if (error) {
Expand Down

0 comments on commit 4ac96f5

Please sign in to comment.