Prevent NullPointerException when data is null during a Payment

This commit is contained in:
Xavier Sellier 2018-04-03 22:10:58 -04:00
parent 0b180a0732
commit d87578c3cd

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);