1
1
mirror of https://github.com/kokonect-link/cherrypick synced 2024-12-13 22:28:58 +09:00

[Server] Fix bug: リモートユーザーのアイコンが消えることがある問題を修正

This commit is contained in:
syuilo 2019-01-21 11:23:32 +09:00
parent 8a5c8e8e2e
commit e9ebc5151d
No known key found for this signature in database
GPG Key ID: BDC4C49D06AB9D69

View File

@ -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);