Merge pull request #17954 from xsellier/bugfix/null-pointer-exception-android-payment

Prevent NullPointerException when data is null during a Payment
This commit is contained in:
Rémi Verschelde 2018-04-05 18:31:14 +02:00 committed by GitHub
commit 14a5888a80
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 5 deletions

View File

@ -56,12 +56,11 @@ abstract public class HandlePurchaseTask {
}
public void handlePurchaseRequest(int resultCode, Intent data) {
PaymentsCache pc = new PaymentsCache(context);
String purchaseData = data.getStringExtra("INAPP_PURCHASE_DATA");
String dataSignature = data.getStringExtra("INAPP_DATA_SIGNATURE");
if (resultCode == Activity.RESULT_OK) {
PaymentsCache pc = new PaymentsCache(context);
String purchaseData = data.getStringExtra("INAPP_PURCHASE_DATA");
String dataSignature = data.getStringExtra("INAPP_DATA_SIGNATURE");
try {
JSONObject jo = new JSONObject(purchaseData);