Permalink
Browse files

Update lib/bson/objectid.js

  • Loading branch information...
1 parent 1211119 commit 7513db5bda96990c828ad5bdeac2df8da5604489 @dwerner dwerner committed Mar 17, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/bson/objectid.js
View
@@ -221,7 +221,7 @@ ObjectID.createFromTime = function createFromHexString(time) {
*/
ObjectID.createFromHexString = function createFromHexString (hexString) {
// Throw an error if it's not a valid setup
- if(hexString != null && hexString.length != 24) throw new Error("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters in hex format");
+ if(typeof hexString === 'undefined' || hexString != null && hexString.length != 24) throw new Error("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters in hex format");
var len = hexString.length;

0 comments on commit 7513db5

Please sign in to comment.