Fail gracefully when no web worker support on initWorker

This commit is contained in:
Tankred Hase 2016-02-09 07:52:08 +07:00
parent 9634440341
commit ee07b77320

View File

@ -52,8 +52,7 @@ let asyncProxy; // instance of the asyncproxy
export function initWorker({ path='openpgp.worker.js', worker } = {}) {
if (worker || typeof window !== 'undefined' && window.Worker) {
asyncProxy = new AsyncProxy({ path, worker, config });
} else {
throw new Error('Initializing web worker failed');
return true;
}
}