Skip to content

Commit 3b24cdd

Browse files
committed
Check for undefined value
1 parent 1d1e1c6 commit 3b24cdd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

specifyweb/frontend/js_src/lib/components/FormSliders/AttachmentsCollection.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export function AttachmentsCollection({
3333
);
3434

3535
const attachmentHasChanged =
36-
collection.models.length > 0 && collection.models.at(-1).needsSaved;
36+
collection.models.length > 0 && collection.models.at(-1)?.needsSaved;
3737

3838
const attachments: RA<SerializedResource<Attachment>> = React.useMemo(
3939
() =>

0 commit comments

Comments
 (0)