Skip to content

Commit

Permalink
fix crash (#566)
Browse files Browse the repository at this point in the history
* fix attributed string crash
* fix limited photo access
  • Loading branch information
sleushunou authored Oct 3, 2024
1 parent 05980b1 commit 90e608f
Show file tree
Hide file tree
Showing 2 changed files with 10 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
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public static PermissionStatus ToPermissionStatus(this PluginPermissionStatus pe
{
PluginPermissionStatus.Denied => PermissionStatus.Denied,
PluginPermissionStatus.Disabled => PermissionStatus.Denied,
PluginPermissionStatus.Limited => PermissionStatus.Granted,
PluginPermissionStatus.Granted => PermissionStatus.Granted,
PluginPermissionStatus.Restricted => PermissionStatus.Restricted,
PluginPermissionStatus.Unknown => PermissionStatus.Unknown,
Expand Down

0 comments on commit 90e608f

Please sign in to comment.