diff --git a/src/browser/services/DecorationService.ts b/src/browser/services/DecorationService.ts index 2ea164293..287852247 100644 --- a/src/browser/services/DecorationService.ts +++ b/src/browser/services/DecorationService.ts @@ -106,7 +106,7 @@ export class Decoration extends Disposable implements IDecoration { } private _createElement(renderService: IRenderService, shouldRecreate?: boolean): void { - if (shouldRecreate && this._element) { + if (shouldRecreate && this._element && this._container.contains(this._element)) { this._container.removeChild(this._element); } this._element = document.createElement('div');