diff --git a/lib/models/patch.dart b/lib/models/patch.dart index 199cbb87..ebcebf59 100644 --- a/lib/models/patch.dart +++ b/lib/models/patch.dart @@ -73,11 +73,14 @@ class Option { static void _migrateV17ToV19(Map json) { if (json['valueType'] == null) { - json['valueType'] = json['optionClassType'] - .replace('PatchOption', '') - .replace('List', 'Array'); + final type = json['optionClassType']; + if (type is String) { + json['valueType'] = type + .replaceAll('PatchOption', '') + .replaceAll('List', 'Array'); - json['optionClassType'] = null; + json['optionClassType'] = null; + } } }