From d07c27f14b0e56a19de71398f2b87d7bfc7987ea Mon Sep 17 00:00:00 2001 From: Valeri Karpov Date: Sat, 23 Jan 2021 18:43:19 -0500 Subject: [PATCH] fix(write_concern): avoid throwing error when `options` is null --- src/write_concern.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/write_concern.ts b/src/write_concern.ts index b2ab9262fce..e73c3a548ff 100644 --- a/src/write_concern.ts +++ b/src/write_concern.ts @@ -75,7 +75,7 @@ export class WriteConcern { options?: WriteConcernOptions | WriteConcern | W, inherit?: WriteConcernOptions | WriteConcern ): WriteConcern | undefined { - if (typeof options === 'undefined') return undefined; + if (options == null) return undefined; inherit = inherit ?? {}; let opts; if (typeof options === 'string' || typeof options === 'number') {