Skip to content

Commit

Permalink
Fix pid set to NaN in browserify
Browse files Browse the repository at this point in the history
  • Loading branch information
rahatarmanahmed committed Nov 30, 2015
1 parent e7dfbf2 commit a5bf719
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion objectid.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

var MACHINE_ID = parseInt(Math.random() * 0xFFFFFF, 10);
var index = ObjectID.index = parseInt(Math.random() * 0xFFFFFF, 10);
var pid = typeof process === 'undefined' ? Math.floor(Math.random() * 100000) : process.pid % 0xFFFF;
var pid = typeof process === 'undefined' || typeof process.pid !== 'number' ? Math.floor(Math.random() * 100000) : process.pid % 0xFFFF;

/**
* Determine if an object is Buffer
Expand Down

0 comments on commit a5bf719

Please sign in to comment.