Merge pull request #2024 from softworkz/FixExcepton

Fix IndexOutOfRangeException
This commit is contained in:
Luke 2016-08-04 23:02:21 -04:00 committed by GitHub
commit 9bd923e2d7

View File

@ -923,14 +923,14 @@ namespace MediaBrowser.Server.Implementations.Library
if (type == typeof(Person))
{
var subFolderIndex = 0;
while (!char.IsLetterOrDigit(validFilename[subFolderIndex]))
foreach (char c in validFilename)
{
subFolderIndex++;
if (char.IsLetterOrDigit(c))
{
subFolderPrefix = c.ToString();
break;
}
}
subFolderPrefix = validFilename.Substring(subFolderIndex, 1);
}
var fullPath = string.IsNullOrEmpty(subFolderPrefix) ?