GetSpecialNodes returns null sometimes. When it does, I get an ArgumentNullException thrown. Is there an elegant way of handling (a change to the linq expression) this besides calling GetSpecialNodes before running the Linq expression and doing a null check?
var nodes = (from HtmlNode node in document.GetSpecialNodes() select node);
May be
var nodes = (document.GetSpecialNodes() ?? new List<HtmlNode>()).ToList<HtmlNode>()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With