diff --git a/packages/payload/src/utilities/isValidID.ts b/packages/payload/src/utilities/isValidID.ts index 0374e0e67..d5b5b467f 100644 --- a/packages/payload/src/utilities/isValidID.ts +++ b/packages/payload/src/utilities/isValidID.ts @@ -4,7 +4,7 @@ export const isValidID = ( value: number | string, type: 'ObjectID' | 'number' | 'text', ): boolean => { - if (type === 'text') return typeof value === 'string' + if (type === 'text') return value && typeof value === 'string' if (typeof value === 'number' && !Number.isNaN(value)) return true if (type === 'ObjectID') {