Skip to content

Commit

Permalink
fix: handle null fields in cloudinary (contentful#1550)
Browse files Browse the repository at this point in the history
  • Loading branch information
rusticpenguin committed Apr 17, 2024
1 parent 91be0d1 commit 7b6b138
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion apps/cloudinary2/src/locations/Field/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ const Field = () => {
const sdk = useSDK<FieldAppSDK<AppInstallationParameters>>();
useAutoResizer({ absoluteElements: true });

const [assets = [], setAssets] = useFieldValue<CloudinaryAsset[]>(sdk.field.id, sdk.field.locale)
const [fieldValue = [], setAssets] = useFieldValue<CloudinaryAsset[] | null>(sdk.field.id, sdk.field.locale);
const assets = fieldValue || [];

const [editingEnabled, setEditingEnabled] = useState(!sdk.field.getIsDisabled());
useEffect(() => {
Expand Down

0 comments on commit 7b6b138

Please sign in to comment.