Skip to content

Commit

Permalink
fix: TypeError: Cannot read property 'dataSource' of null
Browse files Browse the repository at this point in the history
  • Loading branch information
paveltiunov committed Apr 10, 2020
1 parent 158bd10 commit 5bef81b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/cubejs-server-core/core/CompilerApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ class CompilerApi {
const dbType = this.getDbType('default');
const compilers = await this.getCompilers({ requestId: query.requestId });
let sqlGenerator = this.createQuery(compilers, dbType, query);
if (!sqlGenerator) {
throw new Error(`Unknown dbType: ${dbType}`);
}

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

Expand Down

0 comments on commit 5bef81b

Please sign in to comment.