fix: fix NRE on null HtmlNodeCollection
This commit is contained in:
parent
6b3e8d06df
commit
d655b46db5
@ -37,8 +37,14 @@ internal sealed class MastodonService : IMastodonService
|
|||||||
var document = new HtmlDocument();
|
var document = new HtmlDocument();
|
||||||
document.LoadHtml(status.Content);
|
document.LoadHtml(status.Content);
|
||||||
|
|
||||||
HtmlNodeCollection links = document.DocumentNode.SelectNodes("//a");
|
HtmlNodeCollection? links = document.DocumentNode.SelectNodes("//a");
|
||||||
foreach (HtmlNode link in links) link.InnerHtml = link.InnerText;
|
if (links is not null)
|
||||||
|
{
|
||||||
|
foreach (HtmlNode link in links)
|
||||||
|
{
|
||||||
|
link.InnerHtml = link.InnerText;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
status.Content = document.DocumentNode.OuterHtml;
|
status.Content = document.DocumentNode.OuterHtml;
|
||||||
return status;
|
return status;
|
||||||
|
Loading…
Reference in New Issue
Block a user