Skip to content

Commit

Permalink
Merge pull request #1133 from OneSignal/null-check-fix
Browse files Browse the repository at this point in the history
Outcome Event Null Check Fix
  • Loading branch information
rgomezp authored Jan 6, 2021
2 parents 2c78d41 + f33cc5b commit 4ced96b
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ public void sendOutcome(final String name, final Callback callback) {
OneSignal.sendOutcome(name, new OutcomeCallback() {
@Override
public void onSuccess(OSOutcomeEvent outcomeEvent) {
if (outcomeEvent) {
if (outcomeEvent != null) {
try {
callback.invoke(RNUtils.jsonToWritableMap(outcomeEvent.toJSONObject()));
} catch (JSONException e) {
Expand All @@ -555,7 +555,7 @@ public void sendUniqueOutcome(final String name, final Callback callback) {
OneSignal.sendUniqueOutcome(name, new OutcomeCallback() {
@Override
public void onSuccess(OSOutcomeEvent outcomeEvent) {
if (outcomeEvent) {
if (outcomeEvent != null) {
try {
callback.invoke(RNUtils.jsonToWritableMap(outcomeEvent.toJSONObject()));
} catch (JSONException e) {
Expand All @@ -574,7 +574,7 @@ public void sendOutcomeWithValue(final String name, final float value, final Cal
OneSignal.sendOutcomeWithValue(name, value, new OutcomeCallback() {
@Override
public void onSuccess(OSOutcomeEvent outcomeEvent) {
if (outcomeEvent) {
if (outcomeEvent != null) {
try {
callback.invoke(RNUtils.jsonToWritableMap(outcomeEvent.toJSONObject()));
} catch (JSONException e) {
Expand Down

0 comments on commit 4ced96b

Please sign in to comment.