Add Query Editor null checks (#4753)

This commit is contained in:
Karl Burtram
2019-03-28 15:18:44 -07:00
committed by GitHub
parent fdb471d506
commit 7eb17f6abc
2 changed files with 9 additions and 4 deletions

View File

@@ -184,11 +184,15 @@ export class TabbedPanel extends Disposable implements IThemable {
public removeTab(tab: PanelTabIdentifier) {
let actualTab = this._tabMap.get(tab);
if (actualTab.view.remove) {
if (actualTab.view && actualTab.view.remove) {
actualTab.view.remove();
}
actualTab.header.remove();
actualTab.body.remove();
if (actualTab.header && actualTab.header.remove) {
actualTab.header.remove();
}
if (actualTab.body && actualTab.body.remove) {
actualTab.body.remove();
}
dispose(actualTab.disposables);
this._tabMap.delete(tab);
if (this._shownTab === tab) {

View File

@@ -60,7 +60,8 @@ export class ExtHostQueryEditor implements ExtHostQueryEditorShape {
public $onQueryEvent(handle: number, fileUri:string, event: IQueryEvent): void {
let listener: azdata.queryeditor.QueryEventListener = this._queryListeners[handle];
if (listener) {
listener.onQueryEvent(event.type, new ExtHostQueryDocument('MSSQL', fileUri, this._proxy), event.params.planXml);
let planXml = event.params ? event.params.planXml : undefined;
listener.onQueryEvent(event.type, new ExtHostQueryDocument('MSSQL', fileUri, this._proxy), planXml);
}
}
}