Skip to content

Commit

Permalink
fix(platform): potential error if CSS object is undefined (#9968)
Browse files Browse the repository at this point in the history
Fixes a potential error if the global `CSS` object is undefined.

Fixes #9801.
  • Loading branch information
crisbeto authored and andrewseguin committed Feb 20, 2018
1 parent 13e809a commit 3212111
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/cdk/platform/platform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {Injectable} from '@angular/core';

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

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

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

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

0 comments on commit 3212111

Please sign in to comment.