Skip to content

Commit

Permalink
Add null check for "data" in the callback
Browse files Browse the repository at this point in the history
Since the app settings screen does not have an output
  • Loading branch information
shankari committed Jun 5, 2021
1 parent 0e47d50 commit a726584
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/android/DataCollectionPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,13 @@ public void onRequestPermissionResult(int requestCode, String[] permissions,

@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
if (data == null) {
Log.d(cordova.getActivity(), TAG, "received onActivityResult(" + requestCode + "," +
resultCode + "," + "null data" + ")");
} else {
Log.d(cordova.getActivity(), TAG, "received onActivityResult("+requestCode+","+
resultCode+","+data.getDataString()+")");
}
// This will be a NOP if we are not handling the correct activity intent
mControlDelegate.onActivityResult(requestCode, resultCode, data);
/*
Expand Down

0 comments on commit a726584

Please sign in to comment.