Skip to content

Commit

Permalink
Fix incorrect index used in attachment update requests
Browse files Browse the repository at this point in the history
  • Loading branch information
MinnDevelopment committed Nov 18, 2023
1 parent b7937d0 commit 5d5eb94
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -328,9 +328,16 @@ public synchronized DataObject toData()
if (isSet(ATTACHMENTS))
{
DataArray attachments = DataArray.empty();

int fileUploadCount = 0;
for (AttachedFile file : files)
{
attachments.add(file.toAttachmentData(fileUploadCount));
if (file instanceof FileUpload)
fileUploadCount++;
}

json.put("attachments", attachments);
for (int i = 0; i < files.size(); i++)
attachments.add(files.get(i).toAttachmentData(i));
}

return json;
Expand Down

0 comments on commit 5d5eb94

Please sign in to comment.