You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by vi...@apache.org on 2020/01/04 19:52:14 UTC
[incubator-superset] 13/22: Fix error when templateParams is
undefined (#8581)
This is an automated email from the ASF dual-hosted git repository.
villebro pushed a commit to branch 0.35
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git
commit b9941df132962f6d31158269a39e72f366810210
Author: Beto Dealmeida <ro...@dealmeida.net>
AuthorDate: Thu Nov 14 20:22:06 2019 -0800
Fix error when templateParams is undefined (#8581)
---
superset/assets/src/SqlLab/actions/sqlLab.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/superset/assets/src/SqlLab/actions/sqlLab.js b/superset/assets/src/SqlLab/actions/sqlLab.js
index 8f36eca..81f940b 100644
--- a/superset/assets/src/SqlLab/actions/sqlLab.js
+++ b/superset/assets/src/SqlLab/actions/sqlLab.js
@@ -177,7 +177,7 @@ export function estimateQueryCost(query) {
dispatch({ type: COST_ESTIMATE_STARTED, query }),
SupersetClient.post({
endpoint,
- postPayload: { sql, templateParams: JSON.parse(templateParams) },
+ postPayload: { sql, templateParams: JSON.parse(templateParams || '{}') },
})
.then(({ json }) => dispatch({ type: COST_ESTIMATE_RETURNED, query, json }))
.catch(response =>