Skip to content

Commit

Permalink
Merge pull request #3004 from tdonohue/fix_3000
Browse files Browse the repository at this point in the history
Fix `TypeError: Cannot read properties of undefined (reading 'userAgent')`
  • Loading branch information
tdonohue authored May 3, 2024
2 parents efdc357 + 9efcbb2 commit 2a422ba
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/app/root/root.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export class RootComponent implements OnInit {
}

getBrowserName(): string {
const userAgent = this._window.nativeWindow.navigator.userAgent;
const userAgent = this._window.nativeWindow.navigator?.userAgent;
if (/Firefox/.test(userAgent)) {
return 'firefox';
}
Expand All @@ -155,7 +155,7 @@ export class RootComponent implements OnInit {
}

getOSName(): string {
const userAgent = this._window.nativeWindow.navigator.userAgent;
const userAgent = this._window.nativeWindow.navigator?.userAgent;
if (/Windows/.test(userAgent)) {
return 'windows';
}
Expand Down

0 comments on commit 2a422ba

Please sign in to comment.