fix: bug when clearing relationship field without hasMany: true (#1829)

* fix: bug when clearing relationship field without hasMany: true

* fix: checks for null value within function
This commit is contained in:
Jessica Chowdhury
2023-01-09 15:23:40 +00:00
committed by GitHub
parent a10376372a
commit ed7cfff45c

View File

@@ -297,7 +297,7 @@ export type ValueWithRelation = {
}
export function valueIsValueWithRelation(value: unknown): value is ValueWithRelation {
return typeof value === 'object' && 'relationTo' in value && 'value' in value;
return value !== null && typeof value === 'object' && 'relationTo' in value && 'value' in value;
}
export type RelationshipValue = (string | number)