From 1318b5ad45e11eec6b5f83fbea1e3c83caaa545a Mon Sep 17 00:00:00 2001 From: Phillip Kelley-Dotson Date: Fri, 4 Feb 2022 10:21:18 -0800 Subject: [PATCH] fix: sqllab schema select error msg (#18564) * fix: sqllab schema select error msg * remove console logs * fix lint --- superset-frontend/src/SqlLab/actions/sqlLab.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/superset-frontend/src/SqlLab/actions/sqlLab.js b/superset-frontend/src/SqlLab/actions/sqlLab.js index 2605c43e739f..9485cfb650ca 100644 --- a/superset-frontend/src/SqlLab/actions/sqlLab.js +++ b/superset-frontend/src/SqlLab/actions/sqlLab.js @@ -776,12 +776,14 @@ export function queryEditorSetDb(queryEditor, dbId) { export function queryEditorSetSchema(queryEditor, schema) { return function (dispatch) { - const sync = isFeatureEnabled(FeatureFlag.SQLLAB_BACKEND_PERSISTENCE) - ? SupersetClient.put({ - endpoint: encodeURI(`/tabstateview/${queryEditor.id}`), - postPayload: { schema }, - }) - : Promise.resolve(); + const sync = + isFeatureEnabled(FeatureFlag.SQLLAB_BACKEND_PERSISTENCE) && + typeof queryEditor === 'object' + ? SupersetClient.put({ + endpoint: encodeURI(`/tabstateview/${queryEditor.id}`), + postPayload: { schema }, + }) + : Promise.resolve(); return sync .then(() =>