Skip to content

Commit 5bef81b

Browse files
committed
fix: TypeError: Cannot read property 'dataSource' of null
1 parent 158bd10 commit 5bef81b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

packages/cubejs-server-core/core/CompilerApi.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ class CompilerApi {
5353
const dbType = this.getDbType('default');
5454
const compilers = await this.getCompilers({ requestId: query.requestId });
5555
let sqlGenerator = this.createQuery(compilers, dbType, query);
56+
if (!sqlGenerator) {
57+
throw new Error(`Unknown dbType: ${dbType}`);
58+
}
5659

5760
const dataSource = compilers.compiler.withQuery(sqlGenerator, () => sqlGenerator.dataSource);
5861

0 commit comments

Comments
 (0)