Skip to content

Commit

Permalink
Merge pull request #824 from mixpanel/zihe-fix-getOptOutTracking-crash
Browse files Browse the repository at this point in the history
Fix the potential `NullPointException` crash from `getOptOutTracking`
  • Loading branch information
zihejia authored Jan 12, 2024
2 parents 810b4a5 + c5de462 commit 3b5416c
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,9 @@ public synchronized void setOptOutTracking(boolean optOutTracking, String token)
public synchronized boolean getOptOutTracking(String token) {
if (mIsUserOptOut == null) {
readOptOutFlag(token);
if (mIsUserOptOut == null) {
mIsUserOptOut = false;
}
}

return mIsUserOptOut;
Expand Down

0 comments on commit 3b5416c

Please sign in to comment.