Skip to content

Commit d82029d

Browse files
Copilothuangyiirene
andcommitted
Final improvements: explicit undefined handling and safer object fallbacks
Co-authored-by: huangyiirene <7665279+huangyiirene@users.noreply.github.com>
1 parent fb081fa commit d82029d

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

packages/plugin-object/src/ObjectForm.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ export const ObjectForm: React.FC<ObjectFormProps> = ({
146146

147147
if (field.type === 'file' || field.type === 'image') {
148148
formField.multiple = field.multiple;
149-
formField.accept = field.accept?.join(',');
149+
formField.accept = field.accept ? field.accept.join(',') : undefined;
150150
// Add validation hints for file size and dimensions
151151
if (field.max_size) {
152152
const sizeHint = `Max size: ${formatFileSize(field.max_size)}`;

packages/plugin-object/src/ObjectTable.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,12 @@ export const ObjectTable: React.FC<ObjectTableProps> = ({
119119
column.cell = (value: any) => {
120120
if (!value) return '-';
121121
if (typeof value === 'object' && value !== null) {
122-
return value.name || value.label || value._id || JSON.stringify(value);
122+
// Try common display properties first
123+
if (value.name) return value.name;
124+
if (value.label) return value.label;
125+
if (value._id) return value._id;
126+
// Fallback to object type indicator
127+
return '[Object]';
123128
}
124129
return String(value);
125130
};

0 commit comments

Comments
 (0)