Quantcast
Channel: ImapX 2
Viewing all articles
Browse latest Browse all 1952

Commented Issue: Parsing Failed if HeaderKey has no value [1523]

$
0
0
I was parsing quite a few mail and got a crash if a header key has no value as for example:
"X-Spam-Level: "

I added a if statement in the try of EmailParser >> ParseHeaders
try
{
if (num > 0 & !this._emailItems[i].StartsWith('\t'.ToString(CultureInfo.InvariantCulture)) & !this._emailItems[i].StartsWith(' '.ToString(CultureInfo.InvariantCulture)))
{
string text2 = this._emailItems[i].Substring(0, num);
string text3 = String.Empty;
if (this._emailItems[i].Length > num + 1)
{
text3 = this._emailItems[i].Substring(num + 2);
}
Comments: ** Comment from web user: pavel_azanov **

Good evening!

Thank you for feedback and the code snippet! I updated the project source code.

Best regards,

Pavel Azanov


Viewing all articles
Browse latest Browse all 1952


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>