From 6ad0d860c7e04be47f0a084738e3c644bbf70200 Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Fri, 13 Oct 2023 00:12:27 +0200 Subject: [PATCH] fix: Load patches from older versions of ReVanced Manager correctly --- lib/models/patch.dart | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/models/patch.dart b/lib/models/patch.dart index 59c419e7..e9078773 100644 --- a/lib/models/patch.dart +++ b/lib/models/patch.dart @@ -12,7 +12,15 @@ class Patch { required this.options, }); - factory Patch.fromJson(Map json) => _$PatchFromJson(json); + factory Patch.fromJson(Map 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;