Skip to content

Commit

Permalink
fix(NODE-5509): Allow undefined or null params in ObjectId.equals (#607)
Browse files Browse the repository at this point in the history
  • Loading branch information
vanstinator authored Aug 7, 2023
1 parent 9615902 commit e2674c6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/objectid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ export class ObjectId extends BSONValue {
*
* @param otherId - ObjectId instance to compare against.
*/
equals(otherId: string | ObjectId | ObjectIdLike): boolean {
equals(otherId: string | ObjectId | ObjectIdLike | undefined | null): boolean {
if (otherId === undefined || otherId === null) {
return false;
}
Expand Down

0 comments on commit e2674c6

Please sign in to comment.