From 27769347283e6881ee2a15bf0c558f9866403425 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Acid=20Chicken=20=28=E7=A1=AB=E9=85=B8=E9=B6=8F=29?= Date: Fri, 15 Feb 2019 23:42:44 +0900 Subject: [PATCH] Update is-objectid.ts (#4277) * Update is-objectid.ts * Update is-objectid.ts --- src/misc/is-objectid.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/misc/is-objectid.ts b/src/misc/is-objectid.ts index c3148a778..a77c4ee2d 100644 --- a/src/misc/is-objectid.ts +++ b/src/misc/is-objectid.ts @@ -1,5 +1,5 @@ import { ObjectID } from 'mongodb'; export default function(x: any): x is ObjectID { - return x.hasOwnProperty('toHexString') || x.hasOwnProperty('_bsontype'); + return x && typeof x === 'object' && (x.hasOwnProperty('toHexString') || x.hasOwnProperty('_bsontype')); }