From bd2ac73b9f49f2194ee8f156c60bcc3344e1deff Mon Sep 17 00:00:00 2001 From: Imran Remtulla Date: Mon, 9 Dec 2024 17:18:25 -0500 Subject: [PATCH] Catch errors when running JSON compat mods (#2015, #2019) --- lib/providers/source_provider.dart | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/providers/source_provider.dart b/lib/providers/source_provider.dart index 721e8a0..2b2ce68 100644 --- a/lib/providers/source_provider.dart +++ b/lib/providers/source_provider.dart @@ -368,11 +368,13 @@ class App { otherAssetUrls: otherAssetUrls); factory App.fromJson(Map json) { + Map 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,