Преглед изворни кода

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();