Skip to content

Commit

Permalink
Catch errors when running JSON compat mods (#2015, #2019)
Browse files Browse the repository at this point in the history
  • Loading branch information
ImranR98 committed Dec 9, 2024
1 parent c0968e8 commit 26b5a2d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/providers/source_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import 'package:obtainium/app_sources/uptodown.dart';
import 'package:obtainium/components/generated_form.dart';
import 'package:obtainium/custom_errors.dart';
import 'package:obtainium/mass_app_sources/githubstars.dart';
import 'package:obtainium/providers/logs_provider.dart';
import 'package:obtainium/providers/settings_provider.dart';

class AppNames {
Expand Down Expand Up @@ -367,7 +368,12 @@ class App {
otherAssetUrls: otherAssetUrls);

factory App.fromJson(Map<String, dynamic> json) {
json = appJSONCompatibilityModifiers(json);
try {
json = appJSONCompatibilityModifiers(json);
} catch (e) {
LogsProvider()
.add('Error running JSON compat modifiers: ${e.toString()}');
}
return App(
json['id'] as String,
json['url'] as String,
Expand Down

0 comments on commit 26b5a2d

Please sign in to comment.