Merge pull request #7603 from keymanapp/fix/android/package-activity-cleanup

fix(android/app): Add check if bundle to PackageActivity is null
This commit is contained in:
Darcy Wong 2022-11-03 08:02:22 +07:00 committed by GitHub
commit c8259b4d29
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -59,17 +59,20 @@ public class PackageActivity extends AppCompatActivity implements
final Context context = this;
Bundle bundle = getIntent().getExtras();
if (bundle != null) {
kmpFile = new File(bundle.getString("kmpFile"));
if (!kmpFile.exists()) {
showErrorToast(kmpFile.getAbsolutePath() + " not found. Unable to extract");
return;
}
installMode = KmpInstallMode.fromString(bundle.getString("installMode"));
languageID = bundle.getString("language", null);
if (languageID != null && !languageID.isEmpty()) {
languageList.add(languageID);
}
if (bundle == null) {
showErrorToast("No bundle for PackageActivity");
return;
}
kmpFile = new File(bundle.getString("kmpFile"));
if (!kmpFile.exists()) {
showErrorToast(kmpFile.getAbsolutePath() + " not found. Unable to extract");
return;
}
installMode = KmpInstallMode.fromString(bundle.getString("installMode"));
languageID = bundle.getString("language", null);
if (languageID != null && !languageID.isEmpty()) {
languageList.add(languageID);
}
File resourceRoot = new File(context.getDir("data", Context.MODE_PRIVATE).toString() + File.separator);