Avoid null reference exceptions

This commit is contained in:
Paul Schneider
2025-02-01 22:15:31 +00:00
parent e56e1c59b9
commit aa71ff8761
2 changed files with 3 additions and 3 deletions

View File

@ -90,11 +90,11 @@ namespace Yavsc.Helpers
case "AsciiDocNet.TextLiteral":
var tl = elt as TextLiteral;
if (tl.Attributes.Anchor!=null)
if (tl?.Attributes.Anchor!=null)
{
sb.AppendFormat("<a name=\"{0}\">{1}</a> ", tl.Attributes.Anchor.Id, tl.Attributes.Anchor.XRefLabel);
}
sb.Append(tl.Text);
if (tl!=null) sb.Append(tl.Text);
break;
case "AsciiDocNet.Emphasis":

View File

@ -42,7 +42,7 @@
<PackageReference Include="Microsoft.AspNetCore.Antiforgery" Version="2.2.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="8.0.2" IncludeAssets="All" />
<PackageReference Include="AsciiDocNet" Version="1.0.0" />
<PackageReference Include="AsciiDocNet" Version="1.0.0-alpha6" />
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.6" />
</ItemGroup>