Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

fix(gesture): check if navigator is defined before accessing userAgent #11755

Merged
merged 1 commit into from
Jul 10, 2019

Conversation

Splaktar
Copy link
Contributor

@Splaktar Splaktar commented Jun 26, 2019

PR Checklist

Please check that your PR fulfills the following requirements:

  • The commit message follows our guidelines
  • Tests for the changes have been added or this is not a bug fix / enhancement
  • Docs have been added, updated, or were not required

PR Type

What kind of change does this PR introduce?

[x] Bugfix
[ ] Enhancement
[ ] Documentation content changes
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Infrastructure changes
[ ] Other... Please describe:

What is the current behavior?

PR #11729 in 1.1.19 moved the check for navigator outside of code that depends on gestures being enabled. Since it doesn't check the existence of window.navigator first, this could throw an error when built via angular/material-tools.

Issue Number:
Fixes #11751

What is the new behavior?

Fixes a build error when using angular/material-tools by checking that window.navigator is defined before accessing it.

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

We don't have any tests that verify changes to angular/material don't break angular/material-tools. This was manually verified in #11751 (comment).

fixes a build error when using `angular/material-tools`

Fixes #11751
@googlebot googlebot added the cla: yes PR author has signed Google's CLA: https://opensource.google.com/docs/cla/ label Jun 26, 2019
@Splaktar Splaktar added this to the 1.1.20 milestone Jun 26, 2019
@Splaktar Splaktar self-assigned this Jun 26, 2019
@Splaktar Splaktar added P2: required Issues that must be fixed. severity: regression This issue is related to a regression type: bug pr: merge ready This PR is ready for a caretaker to review labels Jun 26, 2019
@jelbourn jelbourn merged commit 0077d3e into master Jul 10, 2019
@Splaktar Splaktar deleted the gesture-fixMaterialToolsBuild branch July 10, 2019 19:13
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes PR author has signed Google's CLA: https://opensource.google.com/docs/cla/ P2: required Issues that must be fixed. pr: merge ready This PR is ready for a caretaker to review severity: regression This issue is related to a regression type: bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Broken building with material-tools
5 participants