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 26b5a2d commit bd2ac73
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/providers/source_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -368,11 +368,13 @@ class App {
otherAssetUrls: otherAssetUrls);

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

0 comments on commit bd2ac73

Please sign in to comment.