summaryrefslogtreecommitdiff
path: root/ext/js/extension/web-extension.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/js/extension/web-extension.js')
-rw-r--r--ext/js/extension/web-extension.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/js/extension/web-extension.js b/ext/js/extension/web-extension.js
index 95a61339..2aafbe92 100644
--- a/ext/js/extension/web-extension.js
+++ b/ext/js/extension/web-extension.js
@@ -91,7 +91,8 @@ export class WebExtension extends EventDispatcher {
*/
getLastError() {
const {lastError} = chrome.runtime;
- if (typeof lastError !== 'undefined') {
+ if (lastError) {
+ if (lastError instanceof Error) { return lastError; }
const {message} = lastError;
return new Error(typeof message === 'string' ? message : 'An unknown web extension error occured');
}