소스 검색

panel: defensive coding that fixes #15563

If a plugin incorrectly uses an attribute in the
query-editor-row directive, it should not throw
an exception.
Daniel Lee 6 년 전
부모
커밋
bd0f55cbb8
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      public/app/features/panel/query_editor_row.ts

+ 1 - 1
public/app/features/panel/query_editor_row.ts

@@ -14,7 +14,7 @@ export class QueryRowCtrl {
     this.target = this.queryCtrl.target;
     this.panel = this.panelCtrl.panel;
 
-    if (this.hasTextEditMode) {
+    if (this.hasTextEditMode && this.queryCtrl.toggleEditorMode) {
       // expose this function to react parent component
       this.panelCtrl.toggleEditorMode = this.queryCtrl.toggleEditorMode.bind(this.queryCtrl);
     }