eschutho commented on code in PR #20877:
URL: https://github.com/apache/superset/pull/20877#discussion_r940726057


##########
superset-frontend/src/SqlLab/actions/sqlLab.js:
##########
@@ -620,6 +677,7 @@ export function switchQueryEditor(queryEditor, 
displayLimit) {
   return function (dispatch) {
     if (
       isFeatureEnabled(FeatureFlag.SQLLAB_BACKEND_PERSISTENCE) &&
+      queryEditor &&

Review Comment:
   maybe use optional chaining here as well?



##########
superset-frontend/src/SqlLab/App.jsx:
##########
@@ -91,6 +94,12 @@ const sqlLabPersistStateConfig = {
       const result = {
         ...initialState,
         ...persistedState,
+        sqlLab: {
+          ...(persistedState && persistedState.sqlLab),

Review Comment:
   if `persistedState` is null or undefined, this will error when you try to 
spread it. I'd recommend a default of an empty object.. maybe something like 
   ```suggestion
             ...(persistedState?.sqlLab || {}),
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to