From e48328af34d8efcb3abd3a2ab29b3b38c6b71764 Mon Sep 17 00:00:00 2001 From: Anthony Dresser Date: Mon, 26 Nov 2018 14:49:06 -0800 Subject: [PATCH] Handle qp clear input correctly (#3258) * handle clearing xml in qp view * formatting --- src/sql/parts/queryPlan/queryPlan.ts | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/sql/parts/queryPlan/queryPlan.ts b/src/sql/parts/queryPlan/queryPlan.ts index 46ee5b1e86..8338ff6510 100644 --- a/src/sql/parts/queryPlan/queryPlan.ts +++ b/src/sql/parts/queryPlan/queryPlan.ts @@ -103,13 +103,15 @@ export class QueryPlan { public set xml(xml: string) { this._xml = xml; new Builder(this.container).empty(); - QP.showPlan(this.container, this._xml, { - jsTooltips: false - }); - (this.container.querySelectorAll('div.qp-tt')).forEach(toolTip => { - toolTip.classList.add('monaco-editor'); - toolTip.classList.add('monaco-editor-hover'); - }); + if (this.xml) { + QP.showPlan(this.container, this._xml, { + jsTooltips: false + }); + (this.container.querySelectorAll('div.qp-tt')).forEach(toolTip => { + toolTip.classList.add('monaco-editor'); + toolTip.classList.add('monaco-editor-hover'); + }); + } } public get xml(): string {