diff --git a/superset/assets/javascripts/SqlLab/components/QueryTable.jsx b/superset/assets/javascripts/SqlLab/components/QueryTable.jsx index 9637c5d05c27..022d48243003 100644 --- a/superset/assets/javascripts/SqlLab/components/QueryTable.jsx +++ b/superset/assets/javascripts/SqlLab/components/QueryTable.jsx @@ -133,7 +133,7 @@ class QueryTable extends React.PureComponent { } else { // if query was run using ctas and force_ctas_schema was set // tempTable will have the schema - const schemaUsed = q.ctas && q.tempTable.includes('.') ? '' : q.schema; + const schemaUsed = q.ctas && q.tempTable && q.tempTable.includes('.') ? '' : q.schema; q.output = [schemaUsed, q.tempTable].filter((v) => (v)).join('.'); } q.progress = (