From 1df2cfacbd6f043bb79fa7ad2eb48daac67b099a Mon Sep 17 00:00:00 2001 From: SbDove <100377552+SbDove@users.noreply.github.com> Date: Thu, 13 Jul 2023 11:05:12 -0700 Subject: [PATCH] adds check for mParticle.Identity --- dist/BrazeKit.common.js | 19 ++----------------- dist/BrazeKit.iife.js | 19 ++----------------- src/BrazeKit-dev.js | 2 +- 3 files changed, 5 insertions(+), 35 deletions(-) diff --git a/dist/BrazeKit.common.js b/dist/BrazeKit.common.js index cad5690..a298fa1 100644 --- a/dist/BrazeKit.common.js +++ b/dist/BrazeKit.common.js @@ -9929,23 +9929,8 @@ var constructor = function () { function finishBrazeInitialization(forwarderSettings) { braze.addSdkMetadata(['mp']); primeBrazeWebPush(); - - // var user = { - // getUserIdentities: function() { - // return { - // userIdentities: { - // customerid: 'abc123', - // email: 'test@test.com', - // facebook: 'fbID1', - // }, - // }; - // }, - // getMPID: function() { - // return 'MPID123'; - // }, - // }; - - if (forwarderSettings.userIdentificationType === 'MPID' && mParticle.Identity.getCurrentUser().getMPID() != null) { + + if (forwarderSettings.userIdentificationType === 'MPID' && mParticle.Identity != null && mParticle.Identity.getCurrentUser().getMPID() != null) { onUserIdentified(mParticle.Identity.getCurrentUser()); } diff --git a/dist/BrazeKit.iife.js b/dist/BrazeKit.iife.js index 36502f3..692a31a 100644 --- a/dist/BrazeKit.iife.js +++ b/dist/BrazeKit.iife.js @@ -9929,23 +9929,8 @@ var mpBrazeKitV4 = (function (exports) { function finishBrazeInitialization(forwarderSettings) { braze.addSdkMetadata(['mp']); primeBrazeWebPush(); - - // var user = { - // getUserIdentities: function() { - // return { - // userIdentities: { - // customerid: 'abc123', - // email: 'test@test.com', - // facebook: 'fbID1', - // }, - // }; - // }, - // getMPID: function() { - // return 'MPID123'; - // }, - // }; - - if (forwarderSettings.userIdentificationType === 'MPID' && mParticle.Identity.getCurrentUser().getMPID() != null) { + + if (forwarderSettings.userIdentificationType === 'MPID' && mParticle.Identity != null && mParticle.Identity.getCurrentUser().getMPID() != null) { onUserIdentified(mParticle.Identity.getCurrentUser()); } diff --git a/src/BrazeKit-dev.js b/src/BrazeKit-dev.js index 82cff7e..b045919 100644 --- a/src/BrazeKit-dev.js +++ b/src/BrazeKit-dev.js @@ -776,7 +776,7 @@ var constructor = function () { braze.addSdkMetadata(['mp']); primeBrazeWebPush(); - if (forwarderSettings.userIdentificationType === 'MPID' && mParticle.Identity.getCurrentUser().getMPID() != null) { + if (forwarderSettings.userIdentificationType === 'MPID' && mParticle.Identity != null && mParticle.Identity.getCurrentUser().getMPID() != null) { onUserIdentified(mParticle.Identity.getCurrentUser()) }