Skip to content

Commit a65d2f4

Browse files
crisbetojelbourn
authored andcommitted
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.
1 parent 857c217 commit a65d2f4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/lib/core/compatibility/compatibility.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ export class CompatibilityModule {
190190
}
191191

192192
private _checkTheme(): void {
193-
if (this._document) {
193+
if (this._document && typeof getComputedStyle === 'function') {
194194
const testElement = this._document.createElement('div');
195195

196196
testElement.classList.add('mat-theme-loaded-marker');

0 commit comments

Comments
 (0)