Skip to content

Commit ad2fdff

Browse files
committed
possibly better
1 parent 3a45f6c commit ad2fdff

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/src/substituter.dart

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,11 @@ class PostgreSQLFormat {
5555
static String substitute(String fmtString, Map<String, dynamic>? values,
5656
{SQLReplaceIdentifierFunction? replace}) {
5757
final converter = PostgresTextEncoder();
58-
values ??= const {};
59-
replace ??= (spec, index) => converter.convert(values![spec.name]);
58+
if (values != null) {
59+
replace ??= (spec, index) => converter.convert(values[spec.name]);
60+
} else {
61+
replace = (spec, index) => '';
62+
}
6063

6164
final items = <PostgreSQLFormatToken>[];
6265
PostgreSQLFormatToken? currentPtr;

0 commit comments

Comments
 (0)