This is an automated email from the ASF dual-hosted git repository.

christine pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git


The following commit(s) were added to refs/heads/master by this push:
     new c04c0cd  Add a safety check before getting clientHeight (#6923)
c04c0cd is described below

commit c04c0cd8f01e2f771c7356b2592726b4d7c73881
Author: Christine Chambers <[email protected]>
AuthorDate: Wed Feb 20 14:31:28 2019 -0800

    Add a safety check before getting clientHeight (#6923)
    
    Seeing an intermittent repro of the `current` nodes of the sql editor and 
south pane refs returning null. Adding a safety check for both nodes.
---
 superset/assets/src/SqlLab/components/SouthPane.jsx | 2 +-
 superset/assets/src/SqlLab/components/SqlEditor.jsx | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/superset/assets/src/SqlLab/components/SouthPane.jsx 
b/superset/assets/src/SqlLab/components/SouthPane.jsx
index 40d46da..e3e51e2 100644
--- a/superset/assets/src/SqlLab/components/SouthPane.jsx
+++ b/superset/assets/src/SqlLab/components/SouthPane.jsx
@@ -64,7 +64,7 @@ export class SouthPane extends React.PureComponent {
   }
   // One layer of abstraction for easy spying in unit tests
   getSouthPaneHeight() {
-    return this.southPaneRef.current.clientHeight;
+    return this.southPaneRef.current ? this.southPaneRef.current.clientHeight 
: 0;
   }
   switchTab(id) {
     this.props.actions.setActiveSouthPaneTab(id);
diff --git a/superset/assets/src/SqlLab/components/SqlEditor.jsx 
b/superset/assets/src/SqlLab/components/SqlEditor.jsx
index dccad0b..bd6a3f5 100644
--- a/superset/assets/src/SqlLab/components/SqlEditor.jsx
+++ b/superset/assets/src/SqlLab/components/SqlEditor.jsx
@@ -122,7 +122,7 @@ class SqlEditor extends React.PureComponent {
   }
   // One layer of abstraction for easy spying in unit tests
   getSqlEditorHeight() {
-    return this.sqlEditorRef.current.clientHeight;
+    return this.sqlEditorRef.current ? this.sqlEditorRef.current.clientHeight 
: 0;
   }
   // Return the heights for the ace editor and the south pane as an object
   // given the height of the sql editor, north pane percent and south pane 
percent.

Reply via email to