From a65d2f4c0f0b18694c669bdf9e9590d641a7381b Mon Sep 17 00:00:00 2001 From: Kristiyan Kostadinov Date: Tue, 11 Apr 2017 08:58:24 -0700 Subject: [PATCH] fix(compatibility): error in theme check with angular universal (#3872) 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 341e5af7fdd..faa00bcda7a 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');