diff options
1102: Fix inpage listener syntax (#5708) (#5709)
Diffstat (limited to 'app')
-rw-r--r-- | app/scripts/inpage.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/scripts/inpage.js b/app/scripts/inpage.js index a7c0b0416..cfcf5e364 100644 --- a/app/scripts/inpage.js +++ b/app/scripts/inpage.js @@ -30,8 +30,8 @@ console.warn('ATTENTION: In an effort to improve user privacy, MetaMask ' + * @param {boolean} remove - removes this handler after being triggered */ function onMessage(messageType, handler, remove) { - window.addEventListener('message', function ({ data: { type } }) { - if (type !== messageType) { return } + window.addEventListener('message', function ({ data }) { + if (!data || data.type !== messageType) { return } remove && window.removeEventListener('message', handler) handler.apply(window, arguments) }) |