diff --git a/superset-frontend/src/SqlLab/components/SqlEditor.jsx b/superset-frontend/src/SqlLab/components/SqlEditor.jsx index 689c4c46f3..044fee86ae 100644 --- a/superset-frontend/src/SqlLab/components/SqlEditor.jsx +++ b/superset-frontend/src/SqlLab/components/SqlEditor.jsx @@ -199,13 +199,21 @@ class SqlEditor extends React.PureComponent { name: 'runQuery1', key: 'ctrl+r', descr: t('Run query'), - func: this.runQuery, + func: () => { + if (this.state.sql.trim() !== '') { + this.runQuery(); + } + }, }, { name: 'runQuery2', key: 'ctrl+enter', descr: t('Run query'), - func: this.runQuery, + func: () => { + if (this.state.sql.trim() !== '') { + this.runQuery(); + } + }, }, { name: 'newTab',