Selaa lähdekoodia

Fix NullReferenceException in GetPathProtocol when path is null

theguymadmax 1 kuukausi sitten
vanhempi
sitoutus
511223aac4
1 muutettua tiedostoa jossa 5 lisäystä ja 0 poistoa
  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 />>
         public MediaProtocol GetPathProtocol(string path)
         {
+            if (string.IsNullOrEmpty(path))
+            {
+                return MediaProtocol.File;
+            }
+
             if (path.StartsWith("Rtsp", StringComparison.OrdinalIgnoreCase))
             {
                 return MediaProtocol.Rtsp;