Avoid package receiver NPE crashes. Fixes #380.
This commit is contained in:
parent
968b35f324
commit
3f5b5ffc93
@ -22,6 +22,8 @@
|
||||
|
||||
* Fix privileged installer confirmation screen issues on Android 2.X/3.X/4.X
|
||||
|
||||
* Fix a few crashes, including package receivers and NFC actions
|
||||
|
||||
### 0.95.1 (2015-08-10)
|
||||
|
||||
* Disable prompt to install F-Droid into system until it's more stable
|
||||
|
@ -43,6 +43,10 @@ public class PackageAddedReceiver extends PackageReceiver {
|
||||
@Override
|
||||
protected void handle(Context context, String appId) {
|
||||
PackageInfo info = getPackageInfo(context, appId);
|
||||
if (info == null) {
|
||||
Log.d(TAG, "Could not get package info on '" + appId + "' - skipping.");
|
||||
return;
|
||||
}
|
||||
|
||||
Log.d(TAG, "Inserting installed app info for '" + appId + "' (v" + info.versionCode + ")");
|
||||
|
||||
|
@ -45,6 +45,10 @@ public class PackageUpgradedReceiver extends PackageReceiver {
|
||||
@Override
|
||||
protected void handle(Context context, String appId) {
|
||||
PackageInfo info = getPackageInfo(context, appId);
|
||||
if (info == null) {
|
||||
Log.d(TAG, "Could not get package info on '" + appId + "' - skipping.");
|
||||
return;
|
||||
}
|
||||
|
||||
Log.d(TAG, "Updating installed app info for '" + appId + "' to v" + info.versionCode + " (" + info.versionName + ")");
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user