Browse Source

Backport pull request #15462 from jellyfin/release-10.11.z

Fix NullReferenceException in GetPathProtocol when path is null

Original-merge: 7c1063177f5647e07c634d36694f0bdec8fe4ff1

Merged-by: joshuaboniface <joshua@boniface.me>

Backported-by: Bond_009 <bond.009@outlook.com>
theguymadmax 3 days ago
parent
commit
e51680cf56
1 changed files with 5 additions and 0 deletions
  1. 5 0
      Emby.Server.Implementations/Library/MediaSourceManager.cs

+ 5 - 0
Emby.Server.Implementations/Library/MediaSourceManager.cs

@@ -226,6 +226,11 @@ namespace Emby.Server.Implementations.Library
         /// <inheritdoc />>
         /// <inheritdoc />>
         public MediaProtocol GetPathProtocol(string path)
         public MediaProtocol GetPathProtocol(string path)
         {
         {
+            if (string.IsNullOrEmpty(path))
+            {
+                return MediaProtocol.File;
+            }
+
             if (path.StartsWith("Rtsp", StringComparison.OrdinalIgnoreCase))
             if (path.StartsWith("Rtsp", StringComparison.OrdinalIgnoreCase))
             {
             {
                 return MediaProtocol.Rtsp;
                 return MediaProtocol.Rtsp;