The Free Software Media System - Server Backend & API
add error handling
Luke Pulverenti9aea46f82375
diff --git a/MediaBrowser.Api/ApiEntryPoint.cs b/MediaBrowser.Api/ApiEntryPoint.csindex 7f4db5a89f..1abbce4084 100644--- a/MediaBrowser.Api/ApiEntryPoint.cs+++ b/MediaBrowser.Api/ApiEntryPoint.cs@@ -709,7 +709,10 @@ namespace MediaBrowser.Apipublic void StartKillTimer(TimerCallback callback, int intervalMs){- CheckHasExited();+ if (HasExited)+ {+ return;+ }lock (_timerLock){@@ -728,7 +731,10 @@ namespace MediaBrowser.Apipublic void ChangeKillTimerIfStarted(){- CheckHasExited();+ if (HasExited)+ {+ return;+ }lock (_timerLock){@@ -741,14 +747,6 @@ namespace MediaBrowser.Api}}}-- private void CheckHasExited()- {- if (HasExited)- {- throw new ObjectDisposedException("Job");- }- }}/// <summary>diff --git a/MediaBrowser.Api/Library/LibraryHelpers.cs b/MediaBrowser.Api/Library/LibraryHelpers.csindex 111922bcad..2e0afa4116 100644--- a/MediaBrowser.Api/Library/LibraryHelpers.cs+++ b/MediaBrowser.Api/Library/LibraryHelpers.cs@@ -56,6 +56,11 @@ namespace MediaBrowser.Api.Library/// <param name="appPaths">The app paths.</param>public static void AddMediaPath(IFileSystem fileSystem, string virtualFolderName, string path, IServerApplicationPaths appPaths){+ if (!string.IsNullOrWhiteSpace(path))+ {+ throw new ArgumentNullException("path");+ }+if (!fileSystem.DirectoryExists(path)){throw new DirectoryNotFoundException("The path does not exist.");