Skip to content

Commit

Permalink
fix: Load patches from older versions of ReVanced Manager correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
oSumAtrIX committed Oct 12, 2023
1 parent 38a2fa5 commit 6ad0d86
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/models/patch.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 6ad0d86

Please sign in to comment.