forked from FoundKeyGang/FoundKey
[Server] Fix bug: リモートユーザーのアイコンが消えることがある問題を修正
This commit is contained in:
parent
8a5c8e8e2e
commit
e9ebc5151d
1 changed files with 2 additions and 1 deletions
|
@ -5,7 +5,8 @@ import isObjectId from './is-objectid';
|
||||||
export const isAnId = (x: any) => mongo.ObjectID.isValid(x);
|
export const isAnId = (x: any) => mongo.ObjectID.isValid(x);
|
||||||
export const isNotAnId = (x: any) => !isAnId(x);
|
export const isNotAnId = (x: any) => !isAnId(x);
|
||||||
export const transform = (x: string | mongo.ObjectID): mongo.ObjectID => {
|
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)) {
|
if (isAnId(x) && !isObjectId(x)) {
|
||||||
return new mongo.ObjectID(x);
|
return new mongo.ObjectID(x);
|
||||||
|
|
Loading…
Reference in a new issue