Browse Source

check timer for null before attempting to dispose

Luke Pulverenti 12 years ago
parent
commit
c16fac0500
1 changed files with 5 additions and 2 deletions
  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.");
                 Logger.Info("Timer stopped.");
 
 
-                _updateTimer.Dispose();
-                _updateTimer = null;
+                if (_updateTimer != null)
+                {
+                    _updateTimer.Dispose();
+                    _updateTimer = null;
+                }
             }
             }
 
 
             var paths = _affectedPaths.Keys.ToList();
             var paths = _affectedPaths.Keys.ToList();