Avoid NPE when no resolver info is available

git-svn-id: https://zxing.googlecode.com/svn/trunk@2796 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
srowen@gmail.com 2013-05-14 21:55:31 +00:00
parent 0e507c4b0c
commit 055d7b84de

View file

@ -120,7 +120,7 @@ public final class CaptureActivityHandler extends Handler {
ResolveInfo resolveInfo =
activity.getPackageManager().resolveActivity(intent, PackageManager.MATCH_DEFAULT_ONLY);
String browserPackageName = null;
if (resolveInfo.activityInfo != null) {
if (resolveInfo != null && resolveInfo.activityInfo != null) {
browserPackageName = resolveInfo.activityInfo.packageName;
Log.d(TAG, "Using browser in package " + browserPackageName);
}