From 3c6e66ce127412399beef79d909f4071c4ec13bf Mon Sep 17 00:00:00 2001 From: Imran Remtulla Date: Sun, 23 Apr 2023 03:22:56 -0400 Subject: [PATCH] Fixed null error for imported Apps (#476) --- lib/main.dart | 2 +- lib/providers/apps_provider.dart | 5 +++-- pubspec.yaml | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index 8b76e13..a3bb694 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -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 diff --git a/lib/providers/apps_provider.dart b/lib/providers/apps_provider.dart index a5b6154..02dd719 100644 --- a/lib/providers/apps_provider.dart +++ b/lib/providers/apps_provider.dart @@ -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); diff --git a/pubspec.yaml b/pubspec.yaml index ea6682f..03380ba 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -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'