Преглед на файлове

Merge pull request #15462 from theguymadmax/fix-exception-for-empty-strm-files

Fix NullReferenceException in GetPathProtocol when path is null
Joshua M. Boniface преди 1 месец
родител
ревизия
7c1063177f
променени са 1 файла, в които са добавени 5 реда и са изтрити 0 реда
  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;