소스 검색

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

Shavonn Brown 6 년 전
부모
커밋
a540f05330
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      public/app/features/explore/QueryEditor.tsx

+ 1 - 1
public/app/features/explore/QueryEditor.tsx

@@ -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();
       }