diff --git a/packages/db/src/clickhouse-client.ts b/packages/db/src/clickhouse-client.ts index eed2ff07..d45f5b71 100644 --- a/packages/db/src/clickhouse-client.ts +++ b/packages/db/src/clickhouse-client.ts @@ -44,7 +44,9 @@ export const originalCh = createClient({ }); const cleanQuery = (query?: string) => - query ? query.replace(/\n/g, '').replace(/\s+/g, ' ').trim() : undefined; + typeof query === 'string' + ? query.replace(/\n/g, '').replace(/\s+/g, ' ').trim() + : undefined; export const ch = new Proxy(originalCh, { get(target, property, receiver) {