diff --git a/src/CommunityToolkit.Maui.MediaElement/Views/MediaManager.macios.cs b/src/CommunityToolkit.Maui.MediaElement/Views/MediaManager.macios.cs index 20c34fa971..0712dc381f 100644 --- a/src/CommunityToolkit.Maui.MediaElement/Views/MediaManager.macios.cs +++ b/src/CommunityToolkit.Maui.MediaElement/Views/MediaManager.macios.cs @@ -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); @@ -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)