From f93cd857cbf10637c01040dfabebeef396b2d9ad Mon Sep 17 00:00:00 2001 From: Daniel Lee Date: Thu, 21 Feb 2019 13:34:10 +0100 Subject: [PATCH] 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. (cherry picked from commit bd0f55cbb875b88a6986a70ee08a21fb44a757c6) --- public/app/features/panel/query_editor_row.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/app/features/panel/query_editor_row.ts b/public/app/features/panel/query_editor_row.ts index fa25ce832be..3c44fab4db3 100644 --- a/public/app/features/panel/query_editor_row.ts +++ b/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); }