fix: Load patches from older versions of ReVanced Manager correctly

This commit is contained in:
oSumAtrIX 2023-10-13 00:12:27 +02:00
parent 38a2fa55df
commit 6ad0d860c7
No known key found for this signature in database
GPG Key ID: A9B3094ACDB604B4

View File

@ -12,7 +12,15 @@ class Patch {
required this.options,
});
factory Patch.fromJson(Map<String, dynamic> json) => _$PatchFromJson(json);
factory Patch.fromJson(Map<String, dynamic> json) {
// See: https://github.com/ReVanced/revanced-manager/issues/1364#issuecomment-1760414618
if (json['options'] == null) {
json['options'] = [];
}
return _$PatchFromJson(json);
}
final String name;
final String? description;
final bool excluded;