summaryrefslogtreecommitdiff
path: root/js/src/Ice/browser/TimerUtil.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/Ice/browser/TimerUtil.js')
-rw-r--r--js/src/Ice/browser/TimerUtil.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/js/src/Ice/browser/TimerUtil.js b/js/src/Ice/browser/TimerUtil.js
index f34b1c35010..90317ec92d5 100644
--- a/js/src/Ice/browser/TimerUtil.js
+++ b/js/src/Ice/browser/TimerUtil.js
@@ -195,7 +195,7 @@ if(typeof(WorkerGlobalScope) !== 'undefined' && this instanceof WorkerGlobalScop
}
else if(worker === undefined)
{
- var url;
+ let url;
try
{
url = URL.createObjectURL(new Blob([workerCode()], {type : 'text/javascript'}));
@@ -205,8 +205,10 @@ else if(worker === undefined)
}
catch(ex)
{
- URL.revokeObjectURL(url);
-
+ if(url !== undefined)
+ {
+ URL.revokeObjectURL(url);
+ }
//
// Fallback on setInterval/setTimeout if the worker creating failed. Some IE10 and IE11 don't
// support creating workers from blob URLs for instance.