瀏覽代碼

try to fix unhandled exception in file refresher

Luke Pulverenti 8 年之前
父節點
當前提交
9fb7bd1367
共有 1 個文件被更改,包括 10 次插入0 次删除
  1. 10 0
      MediaBrowser.Server.Implementations/IO/FileRefresher.cs

+ 10 - 0
MediaBrowser.Server.Implementations/IO/FileRefresher.cs

@@ -45,6 +45,11 @@ namespace MediaBrowser.Server.Implementations.IO
 
         private void AddAffectedPath(string path)
         {
+            if (string.IsNullOrWhiteSpace(path))
+            {
+                throw new ArgumentNullException("path");
+            }
+
             if (!_affectedPaths.Contains(path, StringComparer.Ordinal))
             {
                 _affectedPaths.Add(path);
@@ -53,6 +58,11 @@ namespace MediaBrowser.Server.Implementations.IO
 
         public void AddPath(string path)
         {
+            if (string.IsNullOrWhiteSpace(path))
+            {
+                throw new ArgumentNullException("path");
+            }
+
             lock (_timerLock)
             {
                 AddAffectedPath(path);