Skip to content

Commit 929d606

Browse files
committed
Fix ReferenceOneField empty case handling
1 parent b648d08 commit 929d606

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

packages/ra-ui-materialui/src/field/ReferenceOneField.tsx

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -95,19 +95,15 @@ export const ReferenceOneField = <
9595
) : null;
9696

9797
if (
98-
!record &&
99-
!controllerProps.isPending &&
100-
!controllerProps.isPaused &&
101-
controllerProps.referenceRecord == null
98+
!record ||
99+
(!controllerProps.isPending &&
100+
!controllerProps.isPaused &&
101+
controllerProps.referenceRecord == null)
102102
) {
103103
return empty;
104104
}
105105

106-
if (
107-
!record &&
108-
controllerProps.isPaused &&
109-
controllerProps.referenceRecord == null
110-
) {
106+
if (controllerProps.isPaused && controllerProps.referenceRecord == null) {
111107
return offline;
112108
}
113109

0 commit comments

Comments
 (0)