db.collectionNames throws when options is null

If options is defined but null, it isn't set to an empty object and the call to options.namesOnly causes an error.