Merge pull request #1299 from MediaBrowser/master

fix null checks
This commit is contained in:
Luke 2015-12-05 20:45:06 -05:00
commit cff2678bdf

View File

@ -31,6 +31,11 @@ namespace MediaBrowser.Api.Library
/// <exception cref="System.IO.DirectoryNotFoundException">The media folder does not exist</exception> /// <exception cref="System.IO.DirectoryNotFoundException">The media folder does not exist</exception>
public static void RemoveMediaPath(IFileSystem fileSystem, string virtualFolderName, string mediaPath, IServerApplicationPaths appPaths) public static void RemoveMediaPath(IFileSystem fileSystem, string virtualFolderName, string mediaPath, IServerApplicationPaths appPaths)
{ {
if (string.IsNullOrWhiteSpace(mediaPath))
{
throw new ArgumentNullException("mediaPath");
}
var rootFolderPath = appPaths.DefaultUserViewsPath; var rootFolderPath = appPaths.DefaultUserViewsPath;
var path = Path.Combine(rootFolderPath, virtualFolderName); var path = Path.Combine(rootFolderPath, virtualFolderName);
@ -56,7 +61,7 @@ namespace MediaBrowser.Api.Library
/// <param name="appPaths">The app paths.</param> /// <param name="appPaths">The app paths.</param>
public static void AddMediaPath(IFileSystem fileSystem, string virtualFolderName, string path, IServerApplicationPaths appPaths) public static void AddMediaPath(IFileSystem fileSystem, string virtualFolderName, string path, IServerApplicationPaths appPaths)
{ {
if (!string.IsNullOrWhiteSpace(path)) if (string.IsNullOrWhiteSpace(path))
{ {
throw new ArgumentNullException("path"); throw new ArgumentNullException("path");
} }