Skip to content

Fix ArgumentNullException in HashBlockLevelContent when Unid attribute is missing #53

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: vNext
Choose a base branch
from

Conversation

options
Copy link

@options options commented Jun 30, 2025

This PR fixes an ArgumentNullException that occurs in HashBlockLevelContent when a block-level element (<w:p>, <w:tbl>, <w:tr>) does not have a Unid attribute.

  • Added a null check for the Unid attribute when building the dictionary, so only elements with a non-null Unid are included.
  • This prevents the code from attempting to use a null key in the dictionary, which caused the exception.

Why:
Without this fix, comparing certain Word documents could result in a crash due to missing Unid attributes.

How to test:

  • Run a comparison on Word files that previously caused the exception.
  • The process should now complete without errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant