'Specified argument was out of the range of valid values' when comparing two documents

Hello, I’ve encountered an issue, where if you compare a document where last sections header/footer has link to previous set, and an empty document, the compare throws: java.lang.IllegalArgumentException: Specified argument was out of the range of valid values.
Parameter name: index

Code snippet to reproduce:

Document doc = new Document("path/to/Lorem.docx");

doc.getSections().get(2).getHeadersFooters().linkToPrevious(true);

doc.compare(new Document(), " ", new Date());

Lorem.docx (15.6 KB)

@dfinsolutions
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): WORDSNET-27612

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

The issues you have found earlier (filed as WORDSNET-27612) have been fixed in this Aspose.Words for Java 24.12 update.