diff options
Diffstat (limited to 'app/scripts/controllers/provider-approval.js')
-rw-r--r-- | app/scripts/controllers/provider-approval.js | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/app/scripts/controllers/provider-approval.js b/app/scripts/controllers/provider-approval.js index b8cf04341..2c9182b52 100644 --- a/app/scripts/controllers/provider-approval.js +++ b/app/scripts/controllers/provider-approval.js @@ -28,19 +28,21 @@ class ProviderApprovalController { if (platform && platform.addMessageListener) { platform.addMessageListener(({ action = '', force, origin, siteTitle, siteImage }, { tab }) => { - switch (action) { - case 'init-provider-request': - this._handleProviderRequest(origin, siteTitle, siteImage, force, tab.id) - break - case 'init-is-approved': - this._handleIsApproved(origin, tab.id) - break - case 'init-is-unlocked': - this._handleIsUnlocked(tab.id) - break - case 'init-privacy-request': - this._handlePrivacyRequest(tab.id) - break + if (tab && tab.id) { + switch (action) { + case 'init-provider-request': + this._handleProviderRequest(origin, siteTitle, siteImage, force, tab.id) + break + case 'init-is-approved': + this._handleIsApproved(origin, tab.id) + break + case 'init-is-unlocked': + this._handleIsUnlocked(tab.id) + break + case 'init-privacy-request': + this._handlePrivacyRequest(tab.id) + break + } } }) } |