Skip to content

Commit

Permalink
fix crash
Browse files Browse the repository at this point in the history
  • Loading branch information
sleushunou committed Oct 3, 2024
1 parent 05980b1 commit 9dddbfb
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions Softeq.XToolkit.Common.iOS/Extensions/NSStringExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,17 @@ public static NSMutableAttributedString BuildAttributedStringFromHtml(

if (UIDevice.CurrentDevice.CheckSystemVersion(15, 0))
{
var markdown = new Html2Markdown.Converter().Convert(html);
if (string.IsNullOrEmpty(html))
{
attributedString = new NSAttributedString();
}
else
{
var markdown = new Html2Markdown.Converter().Convert(html);
#pragma warning disable CS8601 // Possible null reference assignment.
attributedString = new NSAttributedString(markdown, default, default, out error);
attributedString = new NSAttributedString(markdown, default, default, out error);
#pragma warning restore CS8601 // Possible null reference assignment.
}
}
else
{
Expand Down

0 comments on commit 9dddbfb

Please sign in to comment.