QueryEditor: check if optional func toggleEditorMode is provided (#18705)

This commit is contained in:
Shavonn Brown
2019-08-26 12:28:43 -04:00
committed by Torkel Ödegaard
parent 66f739815b
commit a540f05330

View File

@@ -73,7 +73,7 @@ export default class QueryEditor extends PureComponent<QueryEditorProps, any> {
const hasNewError = prevProps.error !== this.props.error;
if (this.component) {
if (hasToggledEditorMode) {
if (hasToggledEditorMode && this.angularScope && this.angularScope.toggleEditorMode) {
this.angularScope.toggleEditorMode();
}