Fixed null error for imported Apps (#476)

This commit is contained in:
Imran Remtulla
2023-04-23 03:22:56 -04:00
parent 0213b542e3
commit 3c6e66ce12
3 changed files with 5 additions and 4 deletions

View File

@@ -21,7 +21,7 @@ import 'package:easy_localization/src/easy_localization_controller.dart';
// ignore: implementation_imports
import 'package:easy_localization/src/localization.dart';
const String currentVersion = '0.11.33';
const String currentVersion = '0.11.34';
const String currentReleaseTag =
'v$currentVersion-beta'; // KEEP THIS IN SYNC WITH GITHUB RELEASES

View File

@@ -204,7 +204,8 @@ class AppsProvider with ChangeNotifier {
// The former case should be handled (give the App its real ID), the latter is a security issue
var newInfo = await PackageArchiveInfo.fromPath(downloadedFile.path);
if (app.id != newInfo.packageName) {
if (apps[app.id] != null && !SourceProvider().isTempId(app)) {
var isTempId = SourceProvider().isTempId(app);
if (apps[app.id] != null && !isTempId) {
throw IDChangedError();
}
var originalAppId = app.id;
@@ -213,7 +214,7 @@ class AppsProvider with ChangeNotifier {
'${downloadedFile.parent.path}/${app.id}-${downloadUrl.hashCode}.apk');
if (apps[originalAppId] != null) {
await removeApps([originalAppId]);
await saveApps([app]);
await saveApps([app], onlyIfExists: !isTempId);
}
}
return DownloadedApk(app.id, downloadedFile);

View File

@@ -17,7 +17,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix.
version: 0.11.33+155 # When changing this, update the tag in main() accordingly
version: 0.11.34+156 # When changing this, update the tag in main() accordingly
environment:
sdk: '>=2.18.2 <3.0.0'