From 122d15d553f985615372e2cc076a73979c58dd7d Mon Sep 17 00:00:00 2001 From: Garth Williams Date: Thu, 24 Mar 2022 20:18:37 +0100 Subject: [PATCH] Fix falsy uniqueIdentifierFields causing an exception --- src/lib/prisma-utils/whereUniqueInput.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/prisma-utils/whereUniqueInput.ts b/src/lib/prisma-utils/whereUniqueInput.ts index 9360177c9..a7309d9f0 100644 --- a/src/lib/prisma-utils/whereUniqueInput.ts +++ b/src/lib/prisma-utils/whereUniqueInput.ts @@ -9,7 +9,7 @@ type FieldName = string export const createWhereUniqueInput = (source: RecordUnknown, model: DMMF.Model) => { // TODO There is no reason to compute this every time. Memoize or move. const uniqueIdentifierFields = getUniqueIdentifierFields(model) - const uniqueIdentifierFieldsMissingInData = uniqueIdentifierFields.filter((_) => !source[_]) + const uniqueIdentifierFieldsMissingInData = uniqueIdentifierFields.filter((_) => source[_] == null) if (uniqueIdentifierFieldsMissingInData.length > 0) { // TODO rich errors