Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/utils/components/DetailsItem/DetailsItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,11 @@ export const DetailsItem: FC<DetailsItemProps> = ({

const hide = hideEmpty && _.isEmpty(_.get(obj, path));
const popoverContent: string = description ?? getPropertyDescription(model, path);
const value: ReactNode = children || _.get(obj, path, defaultValue);
// Fall back to the raw resource field only when no children were provided at all.
// An empty or falsy child (for example a missing translation resolving to an empty
// string) must not fall through, otherwise a plain object such as
// metadata.annotations is handed to React as a child and the page crashes.
const value: ReactNode = children ?? _.get(obj, path, defaultValue);
const editable = onEdit && canEdit;

return hide ? null : (
Expand Down