Document comparison crashes when comparing documents with empty table of contents

The document comparison crashes when comparing documents with empty tables of contents.

To reproduce, create two MS Word documents with empty tables of contents.
Compare the documents using Comparer.Compare(…)

This produces the following exception:

  Message=Error occurred in comparing Word documents
   at .([] , [] , CompareOptions ,  )
   at .( , CompareOptions , SaveOptions )
   at GroupDocs.Comparison.Comparer.(Stream , Document , Document , CompareOptions , SaveOptions ,  )
   at GroupDocs.Comparison.Comparer.Compare(Stream document, SaveOptions saveOptions, CompareOptions compareOptions)

This code was run with GroupDocs.Comparison 23.12.0 in a .NET 6.0 console application on a Windows 11 machine:

using var comparer = new Comparer(loadPath1);

I have attached an example document that causes the crash. Compare this file with a copy of the file.
Emtpy_tableOfContents1.docx (14.0 KB)

We get no results when comparing the same documents in the online tool:

I suppose this is because of the same crash

1 Like

This issue is reproduced at our end. Therefore, 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.


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 COMPARISONNET-3833) have been fixed in this update. This message was posted using Bugs notification tool by anton.samarskyy

1 Like