Skip to content

Commit

Permalink
a default of an empty object and optional operator
Browse files Browse the repository at this point in the history
  • Loading branch information
justinpark committed Aug 17, 2022
1 parent 5920999 commit dfb30fc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion superset-frontend/src/SqlLab/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ const sqlLabPersistStateConfig = {
...initialState,
...persistedState,
sqlLab: {
...(persistedState && persistedState.sqlLab),
...(persistedState?.sqlLab || {}),
// Overwrite initialState over persistedState for sqlLab
// since a logic in getInitialState overrides the value from persistedState
...initialState.sqlLab,
Expand Down
2 changes: 1 addition & 1 deletion superset-frontend/src/SqlLab/actions/sqlLab.js
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ export function runQueryFromSqlEditor(
const qe = getUpToDateQuery(getState(), queryEditor, queryEditor.id);
const query = {
dbId: qe.dbId,
sql: qe.selectedText ? qe.selectedText : qe.sql,
sql: qe.selectedText || qe.sql,
sqlEditorId: qe.id,
tab: qe.name,
schema: qe.schema,
Expand Down

0 comments on commit dfb30fc

Please sign in to comment.