Fix crash if purchase service not available
This commit is contained in:
parent
82d804587a
commit
d8913ef63a
1 changed files with 6 additions and 4 deletions
|
@ -298,10 +298,12 @@ public class InAppPurchaseHelper {
|
|||
|
||||
if (buyIntentBundle != null) {
|
||||
PendingIntent pendingIntent = buyIntentBundle.getParcelable(RESPONSE_BUY_INTENT);
|
||||
try {
|
||||
((Activity) mContext).startIntentSenderForResult(pendingIntent.getIntentSender(), ACTIVITY_RESULT_CODE_PURCHASE_ITEM, new Intent(), 0, 0, 0);
|
||||
} catch (SendIntentException e) {
|
||||
Log.e(e);
|
||||
if (pendingIntent != null) {
|
||||
try {
|
||||
((Activity) mContext).startIntentSenderForResult(pendingIntent.getIntentSender(), ACTIVITY_RESULT_CODE_PURCHASE_ITEM, new Intent(), 0, 0, 0);
|
||||
} catch (SendIntentException e) {
|
||||
Log.e(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue