Skip to content

Commit

Permalink
Merge pull request #55 from danawoodman/patch-1
Browse files Browse the repository at this point in the history
Fix crashes in React Native "navigator is not defined"
  • Loading branch information
rauchg committed Apr 3, 2016
2 parents ca248c5 + 748144b commit 149f340
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ var utf8 = require('utf8');
* http://ghinda.net/jpeg-blob-ajax-android/
*/

var isAndroid = navigator.userAgent.match(/Android/i);
var isAndroid = typeof navigator !== 'undefined' && /Android/i.test(navigator.userAgent);

/**
* Check if we are running in PhantomJS.
* Uploading a Blob with PhantomJS does not work correctly, as reported here:
* https://github.com/ariya/phantomjs/issues/11395
* @type boolean
*/
var isPhantomJS = /PhantomJS/i.test(navigator.userAgent);
var isPhantomJS = typeof navigator !== 'undefined' && /PhantomJS/i.test(navigator.userAgent);

/**
* When true, avoids using Blobs to encode payloads.
Expand Down

0 comments on commit 149f340

Please # to comment.