Merge branch 'launch_crash_fix' into 'master'

don't crash when launching an app that isn't installed

See merge request fdroid/fdroidclient!656
This commit is contained in:
Marcus 2018-03-20 17:49:17 +00:00
commit ce0dfa48f9

View File

@ -736,7 +736,12 @@ public class AppDetails2 extends AppCompatActivity
@Override
public void launchApk() {
Intent intent = getPackageManager().getLaunchIntentForPackage(app.packageName);
startActivity(intent);
if (intent != null) {
startActivity(intent);
} else {
// This can happen when the app was just uninstalled.
Toast.makeText(this, R.string.app_not_installed, Toast.LENGTH_LONG).show();
}
}
@Override