Skip to content

Commit 872e3e0

Browse files
crisbetojelbourn
authored andcommitted
fix(platform): potential error if CSS object is undefined (#9968)
Fixes a potential error if the global `CSS` object is undefined. Fixes #9801.
1 parent 5ca154b commit 872e3e0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/cdk/platform/platform.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {Injectable} from '@angular/core';
1010

1111
// Whether the current platform supports the V8 Break Iterator. The V8 check
1212
// is necessary to detect all Blink based browsers.
13-
const hasV8BreakIterator = (typeof(Intl) !== 'undefined' && (Intl as any).v8BreakIterator);
13+
const hasV8BreakIterator = (typeof Intl !== 'undefined' && (Intl as any).v8BreakIterator);
1414

1515
/**
1616
* Service to detect the current platform by comparing the userAgent strings and
@@ -29,8 +29,8 @@ export class Platform {
2929

3030
/** Whether the current rendering engine is Blink. */
3131
// EdgeHTML and Trident mock Blink specific things and need to be excluded from this check.
32-
BLINK: boolean = this.isBrowser &&
33-
(!!((window as any).chrome || hasV8BreakIterator) && !!CSS && !this.EDGE && !this.TRIDENT);
32+
BLINK: boolean = this.isBrowser && (!!((window as any).chrome || hasV8BreakIterator) &&
33+
typeof CSS !== 'undefined' && !this.EDGE && !this.TRIDENT);
3434

3535
/** Whether the current rendering engine is WebKit. */
3636
// Webkit is part of the userAgent in EdgeHTML, Blink and Trident. Therefore we need to

0 commit comments

Comments
 (0)