소스 검색

check timer for null before attempting to dispose

Luke Pulverenti 12 년 전
부모
커밋
c16fac0500
1개의 변경된 파일5개의 추가작업 그리고 2개의 파일을 삭제
  1. 5 2
      MediaBrowser.Server.Implementations/IO/DirectoryWatchers.cs

+ 5 - 2
MediaBrowser.Server.Implementations/IO/DirectoryWatchers.cs

@@ -391,8 +391,11 @@ namespace MediaBrowser.Server.Implementations.IO
 
                 Logger.Info("Timer stopped.");
 
-                _updateTimer.Dispose();
-                _updateTimer = null;
+                if (_updateTimer != null)
+                {
+                    _updateTimer.Dispose();
+                    _updateTimer = null;
+                }
             }
 
             var paths = _affectedPaths.Keys.ToList();