Skip to content

Commit

Permalink
fix: Use correct method name for string replacement
Browse files Browse the repository at this point in the history
  • Loading branch information
oSumAtrIX committed Nov 4, 2023
1 parent e1c6f65 commit 494e268
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions lib/models/patch.dart
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,14 @@ class Option {

static void _migrateV17ToV19(Map<String, dynamic> json) {
if (json['valueType'] == null) {
json['valueType'] = json['optionClassType']
.replace('PatchOption', '')
.replace('List', 'Array');

json['optionClassType'] = null;
final type = json['optionClassType'];
if (type is String) {
json['valueType'] = type
.replaceAll('PatchOption', '')
.replaceAll('List', 'Array');

json['optionClassType'] = null;
}
}
}

Expand Down

0 comments on commit 494e268

Please sign in to comment.