From e9ebc5151d1c9d5c2a82ceebf9d6edd1d4d5aa90 Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 21 Jan 2019 11:23:32 +0900 Subject: [PATCH] =?UTF-8?q?[Server]=20Fix=20bug:=20=E3=83=AA=E3=83=A2?= =?UTF-8?q?=E3=83=BC=E3=83=88=E3=83=A6=E3=83=BC=E3=82=B6=E3=83=BC=E3=81=AE?= =?UTF-8?q?=E3=82=A2=E3=82=A4=E3=82=B3=E3=83=B3=E3=81=8C=E6=B6=88=E3=81=88?= =?UTF-8?q?=E3=82=8B=E3=81=93=E3=81=A8=E3=81=8C=E3=81=82=E3=82=8B=E5=95=8F?= =?UTF-8?q?=E9=A1=8C=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/misc/cafy-id.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/misc/cafy-id.ts b/src/misc/cafy-id.ts index 621f7e794..b99a27ee4 100644 --- a/src/misc/cafy-id.ts +++ b/src/misc/cafy-id.ts @@ -5,7 +5,8 @@ import isObjectId from './is-objectid'; export const isAnId = (x: any) => mongo.ObjectID.isValid(x); export const isNotAnId = (x: any) => !isAnId(x); export const transform = (x: string | mongo.ObjectID): mongo.ObjectID => { - if (x == null) return null; + if (x === undefined) return undefined; + if (x === null) return null; if (isAnId(x) && !isObjectId(x)) { return new mongo.ObjectID(x);