Skip to content

Commit

Permalink
Check for null currentuser
Browse files Browse the repository at this point in the history
  • Loading branch information
rmi22186 committed May 3, 2024
1 parent 34dbadb commit 7883f30
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/BrazeKit-dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -794,9 +794,12 @@ var constructor = function () {
braze.addSdkMetadata(['mp']);
primeBrazeWebPush();

const currentUser = mParticle.Identity != null ? mParticle.Identity.getCurrentUser() : null;
const mpid = currentUser.getMPID();

const currentUser =
mParticle.Identity !== null
? mParticle.Identity.getCurrentUser()
: null;
const mpid = currentUser ? currentUser.getMPID() : null;

if (currentUser && mpid) {
onUserIdentified(currentUser);
}
Expand Down

0 comments on commit 7883f30

Please sign in to comment.