Skip to content
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

fix #68 ignore malformed date in {\info ..} #89

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

Conversation

r-Larch
Copy link

@r-Larch r-Larch commented Aug 23, 2024

This PR fixes #68

If an {\info ..} contained a invalid date like: {\printim\yr0\mo0\dy0\hr0\min0} or {\creatim\yr0\mo0\dy0\hr0\min0}
then a System.ArgumentOutOfRangeException was thrown by the DateTime ctor.

This PR resolves the issue by ignoring the error since a malformed date can never be useful.

System.ArgumentOutOfRangeException Year, Month, and Day parameters describe an un-representable DateTime.
   at System.DateTime..ctor(Int32 year, Int32 month, Int32 day, Int32 hour, Int32 minute, Int32 second)
   at RtfPipe.Parser.ParseInfo(Document document, Group info)
   at RtfPipe.Parser.Parse()
   at RtfPipe.Rtf.ToHtml(RtfSource source, XmlWriter writer, RtfHtmlSettings settings)
   at RtfPipe.Rtf.ToHtml(RtfSource source, RtfHtmlSettings settings)

@lcocea
Copy link

lcocea commented Sep 15, 2024

Please release this fix at your earliest convenience, thank you.

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.

OutOfRangeException: Year, Month, and Day parameters describe an un-representable DateTime
2 participants