Skip to content

Commit

Permalink
Fix IOS crash on invalid or missing file extension on Resource Media …
Browse files Browse the repository at this point in the history
…Source (#1858)
  • Loading branch information
ne0rrmatrix authored May 27, 2024
1 parent 61f2415 commit 534c28d
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ protected virtual partial void PlatformUpdateSource()
{
var path = resourceMediaSource.Path;

if (!string.IsNullOrWhiteSpace(path))
if (!string.IsNullOrWhiteSpace(path) && Path.HasExtension(path))
{
string directory = Path.GetDirectoryName(path) ?? "";
string filename = Path.GetFileNameWithoutExtension(path);
Expand All @@ -236,6 +236,10 @@ protected virtual partial void PlatformUpdateSource()

asset = AVAsset.FromUrl(url);
}
else
{
Logger.LogWarning("Invalid file path for ResourceMediaSource.");
}
}

if (asset is not null)
Expand Down

0 comments on commit 534c28d

Please sign in to comment.