mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
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.
This commit is contained in:
committed by
GitHub
parent
25ec00b3c6
commit
c04c0cd8f0
@@ -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);
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user