Skip to content

Commit

Permalink
Add null check for Jetpack connect source to magic link classes
Browse files Browse the repository at this point in the history
  • Loading branch information
theck13 committed Apr 20, 2018
1 parent 8069afc commit 398eb4d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -241,10 +241,14 @@ public void onStop() {
}

private AuthEmailPayloadSource getAuthEmailPayloadSource() {
if (mJetpackConnectSource.equalsIgnoreCase(AuthEmailPayloadSource.NOTIFICATIONS.toString())) {
return AuthEmailPayloadSource.NOTIFICATIONS;
} else if (mJetpackConnectSource.equalsIgnoreCase(AuthEmailPayloadSource.STATS.toString())) {
return AuthEmailPayloadSource.STATS;
if (mJetpackConnectSource != null) {
if (mJetpackConnectSource.equalsIgnoreCase(AuthEmailPayloadSource.NOTIFICATIONS.toString())) {
return AuthEmailPayloadSource.NOTIFICATIONS;
} else if (mJetpackConnectSource.equalsIgnoreCase(AuthEmailPayloadSource.STATS.toString())) {
return AuthEmailPayloadSource.STATS;
} else {
return null;
}
} else {
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,14 @@ protected void sendMagicLinkEmail() {
}

private AuthEmailPayloadSource getAuthEmailPayloadSource() {
if (mJetpackConnectSource.equalsIgnoreCase(AuthEmailPayloadSource.NOTIFICATIONS.toString())) {
return AuthEmailPayloadSource.NOTIFICATIONS;
} else if (mJetpackConnectSource.equalsIgnoreCase(AuthEmailPayloadSource.STATS.toString())) {
return AuthEmailPayloadSource.STATS;
if (mJetpackConnectSource != null) {
if (mJetpackConnectSource.equalsIgnoreCase(AuthEmailPayloadSource.NOTIFICATIONS.toString())) {
return AuthEmailPayloadSource.NOTIFICATIONS;
} else if (mJetpackConnectSource.equalsIgnoreCase(AuthEmailPayloadSource.STATS.toString())) {
return AuthEmailPayloadSource.STATS;
} else {
return null;
}
} else {
return null;
}
Expand Down

0 comments on commit 398eb4d

Please sign in to comment.