Skip to content

Commit d782977

Browse files
committed
parse empty variable string as null.
1 parent de4ee85 commit d782977

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/src/api/models/variables_model.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ class VariableData
117117

118118
/// Returns the value converted to the appropriate type according to [type].
119119
Object? getValue() => switch (type) {
120-
VariableType.text => value,
120+
VariableType.text => value.isEmpty ? null : value,
121121
VariableType.integer => num.tryParse(value).toInt(),
122122
VariableType.decimal => num.tryParse(value).toDouble(),
123123
VariableType.boolean => bool.tryParse(value, caseSensitive: false),

0 commit comments

Comments
 (0)