Skip to content

The Free Software Media System - Server Backend & API

check timer for null before attempting to dispose

Luke Pulverentic16fac0500cb
diff --git a/MediaBrowser.Server.Implementations/IO/DirectoryWatchers.cs b/MediaBrowser.Server.Implementations/IO/DirectoryWatchers.cs
index a45d5fed08..3568e446f8 100644
--- a/MediaBrowser.Server.Implementations/IO/DirectoryWatchers.cs
+++ b/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();