Skip to content

Commit 03e2481

Browse files
author
SPRINX0\prochazka
committed
param handler - handle null options
1 parent f689d51 commit 03e2481

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/queryParamHandler.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ function createParameterizerContext(sql: string, options: SplitterOptions) {
1515
}
1616

1717
export function extractQueryParameters(sql: string, options: SplitterOptions): string[] {
18+
if (!sql || !options) {
19+
return [];
20+
}
21+
1822
const context = createParameterizerContext(sql, options);
1923

2024
const res = new Set<string>();
@@ -42,6 +46,10 @@ export function replaceQueryParameters(
4246
params: { [name: string]: string },
4347
options: SplitterOptions
4448
): string {
49+
if (!sql || !options) {
50+
return sql;
51+
}
52+
4553
const context = createParameterizerContext(sql, options);
4654

4755
let res = '';

0 commit comments

Comments
 (0)