Skip to content

Commit 841fac6

Browse files
authored
Merge pull request #270 from fredericrous/patch-1
fix: undefined error issue #269
2 parents f625a13 + 55e0bf9 commit 841fac6

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/store/Store.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,14 @@ class Store {
157157
portName: this.portName,
158158
payload: data
159159
}, null, (resp) => {
160+
if (!resp) {
161+
const error = this.browserAPI.runtime.lastError;
162+
const bgErr = new Error(`${backgroundErrPrefix}${error}`);
163+
164+
reject(assignIn(bgErr, error));
165+
return;
166+
}
167+
160168
const {error, value} = resp;
161169

162170
if (error) {

0 commit comments

Comments
 (0)