aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkumavis <aaron@kumavis.me>2016-07-19 08:57:23 +0800
committerkumavis <aaron@kumavis.me>2016-07-19 08:57:23 +0800
commit9101812552f89439addfa4fbd783ec4bf6b47e0e (patch)
tree1bc82950ab76bbaecdc4e4ff9398bbb27eaf1830
parent5b895c2a229555f127e1bd4b6f5c2973a37537cc (diff)
downloadtangerine-wallet-browser-9101812552f89439addfa4fbd783ec4bf6b47e0e.tar
tangerine-wallet-browser-9101812552f89439addfa4fbd783ec4bf6b47e0e.tar.gz
tangerine-wallet-browser-9101812552f89439addfa4fbd783ec4bf6b47e0e.tar.bz2
tangerine-wallet-browser-9101812552f89439addfa4fbd783ec4bf6b47e0e.tar.lz
tangerine-wallet-browser-9101812552f89439addfa4fbd783ec4bf6b47e0e.tar.xz
tangerine-wallet-browser-9101812552f89439addfa4fbd783ec4bf6b47e0e.tar.zst
tangerine-wallet-browser-9101812552f89439addfa4fbd783ec4bf6b47e0e.zip
inpage - add try/catch to cleanContextForImports
-rw-r--r--app/scripts/inpage.js12
1 files changed, 10 insertions, 2 deletions
diff --git a/app/scripts/inpage.js b/app/scripts/inpage.js
index f5e54cd7b..c2b445bd1 100644
--- a/app/scripts/inpage.js
+++ b/app/scripts/inpage.js
@@ -53,9 +53,17 @@ var __define
function cleanContextForImports () {
__define = global.define
- delete global.define
+ try {
+ delete global.define
+ } catch (_) {
+ console.warn('MetaMask - global.define could not be deleted.')
+ }
}
function restoreContextAfterImports () {
- global.define = __define
+ try {
+ global.define = __define
+ } catch {
+ console.warn('MetaMask - global.define could not be overwritten.')
+ }
}