add error handling

This commit is contained in:
Luke Pulverenti 2017-01-26 13:41:12 -05:00
parent 045fdaf387
commit db4290c74c
1 changed files with 7 additions and 4 deletions

View File

@ -2593,7 +2593,7 @@ namespace Emby.Server.Implementations.Library
{
foreach (var pathInfo in libraryOptions.PathInfos)
{
if (string.IsNullOrWhiteSpace(pathInfo.NetworkPath))
if (string.IsNullOrWhiteSpace(pathInfo.Path) || string.IsNullOrWhiteSpace(pathInfo.NetworkPath))
{
continue;
}
@ -2621,10 +2621,13 @@ namespace Emby.Server.Implementations.Library
foreach (var map in ConfigurationManager.Configuration.PathSubstitutions)
{
var substitutionResult = SubstitutePathInternal(path, map.From, map.To);
if (substitutionResult.Item2)
if (!string.IsNullOrWhiteSpace(map.From))
{
return substitutionResult.Item1;
var substitutionResult = SubstitutePathInternal(path, map.From, map.To);
if (substitutionResult.Item2)
{
return substitutionResult.Item1;
}
}
}