Skip to content

Commit

Permalink
Fix condition failing if no key exists
Browse files Browse the repository at this point in the history
  • Loading branch information
Hedon-dev committed Jan 22, 2025
1 parent 88f55aa commit 68f847b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/services/shared_prefs_manager.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ Future<void> setDefaultSettings([forceReset = false]) async {
}
}
// Attempt to upgrade settings
if (!forceReset && settingsVersion! != packageInfo.version) {
if (settingsVersion != null &&
!forceReset &&
settingsVersion != packageInfo.version) {
logger.w("Settings version changed from "
"${(await sharedStorage.getString("general_settings_version"))} to "
"${packageInfo.version}");
Expand Down

0 comments on commit 68f847b

Please sign in to comment.