Fix possible NullPointerException crash on cancel payment

This commit is contained in:
Konstantin Zaitsev 2018-06-27 13:39:13 +07:00
parent c633b770cb
commit d05db4de8e
1 changed files with 7 additions and 9 deletions

View File

@ -58,6 +58,8 @@ abstract public class HandlePurchaseTask {
public void handlePurchaseRequest(int resultCode, Intent data) { public void handlePurchaseRequest(int resultCode, Intent data) {
//Log.d("XXX", "Handling purchase response"); //Log.d("XXX", "Handling purchase response");
if (resultCode == Activity.RESULT_OK) {
try {
//int responseCode = data.getIntExtra("RESPONSE_CODE", 0); //int responseCode = data.getIntExtra("RESPONSE_CODE", 0);
PaymentsCache pc = new PaymentsCache(context); PaymentsCache pc = new PaymentsCache(context);
@ -65,10 +67,6 @@ abstract public class HandlePurchaseTask {
//Log.d("XXX", "Purchase data:" + purchaseData); //Log.d("XXX", "Purchase data:" + purchaseData);
String dataSignature = data.getStringExtra("INAPP_DATA_SIGNATURE"); String dataSignature = data.getStringExtra("INAPP_DATA_SIGNATURE");
//Log.d("XXX", "Purchase signature:" + dataSignature); //Log.d("XXX", "Purchase signature:" + dataSignature);
if (resultCode == Activity.RESULT_OK) {
try {
//Log.d("SARLANGA", purchaseData); //Log.d("SARLANGA", purchaseData);
JSONObject jo = new JSONObject(purchaseData); JSONObject jo = new JSONObject(purchaseData);