diff --git a/objectid.js b/objectid.js index b3991a9..fea220f 100644 --- a/objectid.js +++ b/objectid.js @@ -95,7 +95,7 @@ ObjectID.createFromHexString = function(hexString) { * http://mongodb.github.io/node-mongodb-native/api-bson-generated/objectid.html#objectid-isvalid */ ObjectID.isValid = function(objectid) { - if(!objectid || (typeof objectid !== 'string' && (typeof objectid !== 'object' || typeof objectid.toString !== 'function'))) return false; + if(!objectid || (typeof objectid !== 'string' && (typeof objectid !== 'object' || Array.isArray(objectid) || typeof objectid.toString !== 'function'))) return false; //call .toString() to get the hex if we're // working with an instance of ObjectID