From 7d3329b5131f2125eaed93c010db84c1092c31ae Mon Sep 17 00:00:00 2001 From: Pavel Tiunov Date: Sat, 11 Apr 2020 13:55:27 -0700 Subject: [PATCH] fix: TypeError: Cannot read property 'timeDimensions' of null --- packages/cubejs-api-gateway/index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/cubejs-api-gateway/index.js b/packages/cubejs-api-gateway/index.js index 044f76a596af2..9d18be4b7a686 100644 --- a/packages/cubejs-api-gateway/index.js +++ b/packages/cubejs-api-gateway/index.js @@ -382,6 +382,9 @@ class ApiGateway { }); const loadRequestSQLStarted = new Date(); const normalizedQuery = await this.queryTransformer(normalizeQuery(query), context); + if (!normalizedQuery) { + throw new Error(`queryTransformer returned null query. Please check your queryTransformer implementation`); + } const [compilerSqlResult, metaConfigResult] = await Promise.all([ this.getCompilerApi(context).getSql(coerceForSqlQuery(normalizedQuery, context)), this.getCompilerApi(context).metaConfig({ requestId: context.requestId })