Skip to content

Commit

Permalink
Merge pull request #5 from CFPrulez/patch-1
Browse files Browse the repository at this point in the history
prevent NullPointerException in IabHelper
  • Loading branch information
DSteve595 committed Mar 16, 2016
2 parents 2bff39a + 28b3069 commit f9ae76f
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,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> resolveInfoList = mContext.getPackageManager().queryIntentServices(serviceIntent, 0);
if (resolveInfoList != null && !resolveInfoList.isEmpty()) {
// service available to handle that Intent
mContext.bindService(serviceIntent, mServiceConn, Context.BIND_AUTO_CREATE);
}
Expand Down

0 comments on commit f9ae76f

Please sign in to comment.