From 378e5098164456e01fe3118ee251f0182caa6f25 Mon Sep 17 00:00:00 2001 From: crisbeto Date: Sat, 1 Apr 2017 20:33:35 +0200 Subject: [PATCH] fix(compatibility): error in theme check with angular universal Fixes a reference error being thrown by the theme check when using server-side rendering. Fixes #3870. --- src/lib/core/compatibility/compatibility.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/core/compatibility/compatibility.ts b/src/lib/core/compatibility/compatibility.ts index 341e5af7fdd6..faa00bcda7ae 100644 --- a/src/lib/core/compatibility/compatibility.ts +++ b/src/lib/core/compatibility/compatibility.ts @@ -190,7 +190,7 @@ export class CompatibilityModule { } private _checkTheme(): void { - if (this._document) { + if (this._document && typeof getComputedStyle === 'function') { const testElement = this._document.createElement('div'); testElement.classList.add('mat-theme-loaded-marker');