From 688b96f7dfa37b53b88eec4e6cb9af75a499fe86 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Fri, 5 May 2017 14:54:10 +0200 Subject: [PATCH] fix #26021 --- src/vs/base/browser/dom.ts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/vs/base/browser/dom.ts b/src/vs/base/browser/dom.ts index b2ec45dbb77c5..21698e938db4a 100644 --- a/src/vs/base/browser/dom.ts +++ b/src/vs/base/browser/dom.ts @@ -160,19 +160,25 @@ const _manualClassList = new class { const _nativeClassList = new class { hasClass(node: HTMLElement, className: string): boolean { - return className && node.classList.contains(className); + return className && node.classList && node.classList.contains(className); } addClass(node: HTMLElement, className: string): void { - return className && node.classList.add(className); + if (className && node.classList) { + node.classList.add(className); + } } removeClass(node: HTMLElement, className: string): void { - return className && node.classList.remove(className); + if (className && node.classList) { + node.classList.remove(className); + } } toggleClass(node: HTMLElement, className: string, shouldHaveIt?: boolean): void { - node.classList.toggle(className, shouldHaveIt); + if (node.classList) { + node.classList.toggle(className, shouldHaveIt); + } } };