Skip to content

Commit

Permalink
fix: Bowser.getParser empty string UserAgent error (#246)
Browse files Browse the repository at this point in the history
  • Loading branch information
silverchen authored and jasonmit committed Aug 2, 2019
1 parent 24fd6f7 commit 2c9c4b9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/@pollyjs/persister/src/har/log.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import uniqWith from 'lodash-es/uniqWith';
import Bowser from 'bowser';

const bowser =
'navigator' in global
? Bowser.getParser(global.navigator.userAgent || '').getBrowser()
global.navigator && global.navigator.userAgent
? Bowser.getParser(global.navigator.userAgent).getBrowser()
: null;
const browser =
bowser && bowser.name && bowser.version
Expand Down

0 comments on commit 2c9c4b9

Please sign in to comment.