Skip to content

Commit 7f2c514

Browse files
handle null exception
1 parent 827bb15 commit 7f2c514

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

android-kit-base/src/main/java/com/mparticle/kits/KitManagerImpl.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1553,12 +1553,12 @@ else if (hashedEmailMismatch && existingHashedEmail != null) {
15531553
if (emailMismatch) {
15541554
identityBuilder.email(email);
15551555
}
1556-
if (hashedEmailMismatch && kitConfiguration != null && kitConfiguration.getHashedEmailUserIdentityType() != null) {
1556+
if (hashedEmailMismatch && kitConfiguration != null) {
15571557
MParticle.IdentityType type;
15581558
try {
15591559
type = MParticle.IdentityType.valueOf(kitConfiguration.getHashedEmailUserIdentityType());
1560-
} catch (IllegalArgumentException e) {
1561-
type = MParticle.IdentityType.Other; // fallback
1560+
} catch (IllegalArgumentException | NullPointerException e) {
1561+
type = MParticle.IdentityType.Other; // fallback if null or invalid
15621562
}
15631563
identityBuilder.userIdentity(type, hashedEmail);
15641564
}

0 commit comments

Comments
 (0)