Skip to content

Commit ed7cfff

Browse files
authored
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
1 parent a103763 commit ed7cfff

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/fields/config/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ export type ValueWithRelation = {
297297
}
298298

299299
export function valueIsValueWithRelation(value: unknown): value is ValueWithRelation {
300-
return typeof value === 'object' && 'relationTo' in value && 'value' in value;
300+
return value !== null && typeof value === 'object' && 'relationTo' in value && 'value' in value;
301301
}
302302

303303
export type RelationshipValue = (string | number)

0 commit comments

Comments
 (0)