Skip to content

Commit

Permalink
Merge pull request #27 from DanDits/patch-1
Browse files Browse the repository at this point in the history
Fixed NPE on devices without billing service
  • Loading branch information
Dominik Schürmann committed Oct 16, 2015
2 parents 1cabc13 + 065cca2 commit ef099b0
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -265,7 +265,8 @@ public void onServiceConnected(ComponentName name, IBinder service) {

Intent serviceIntent = new Intent("com.android.vending.billing.InAppBillingService.BIND");
serviceIntent.setPackage("com.android.vending");
if (!mContext.getPackageManager().queryIntentServices(serviceIntent, 0).isEmpty()) {
List<ResolveInfo> queriedIntentServices = mContext.getPackageManager().queryIntentServices(serviceIntent, 0);
if (queriedIntentServices != null && !queriedIntentServices.isEmpty()) {
// service available to handle that Intent
mContext.bindService(serviceIntent, mServiceConn, Context.BIND_AUTO_CREATE);
}
Expand Down

0 comments on commit ef099b0

Please sign in to comment.