Skip to content

Commit 9a10970

Browse files
committed
Fix null variable values not being handled properly in conditions.
1 parent c1c0c8f commit 9a10970

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/src/api/typed_value.dart

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,12 @@ extension TypedStringExt on String {
8989
/// of this string.
9090
Object? parsedValue() {
9191
if (this == 'null') return null;
92-
return toInt() ?? toDouble() ?? toBool() ?? toList() ?? toMap() ?? this;
92+
return toInt() ??
93+
toDouble() ??
94+
toBool() ??
95+
toList() ??
96+
toMap() ??
97+
(isEmpty ? null : this);
9398
}
9499

95100
/// Converts given string to a known type.

0 commit comments

Comments
 (0)