aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/Library/LibraryManager.cs
diff options
context:
space:
mode:
authorLuke <luke.pulverenti@gmail.com>2016-08-04 23:02:21 -0400
committerGitHub <noreply@github.com>2016-08-04 23:02:21 -0400
commit9bd923e2d7d4b10bc1cc5f1c18993b8fd075b4da (patch)
treeb0721359c09ca996ed6d08973c3282da59d5b9cb /MediaBrowser.Server.Implementations/Library/LibraryManager.cs
parent97446d04df47262bb65cba60868f76a03b3d4edc (diff)
parent6cf28f1c4e191b8599aedc1f71c01de77d7ff7cb (diff)
Merge pull request #2024 from softworkz/FixExcepton
Fix IndexOutOfRangeException
Diffstat (limited to 'MediaBrowser.Server.Implementations/Library/LibraryManager.cs')
-rw-r--r--MediaBrowser.Server.Implementations/Library/LibraryManager.cs12
1 files changed, 6 insertions, 6 deletions
diff --git a/MediaBrowser.Server.Implementations/Library/LibraryManager.cs b/MediaBrowser.Server.Implementations/Library/LibraryManager.cs
index 015fc3778..7af495f5a 100644
--- a/MediaBrowser.Server.Implementations/Library/LibraryManager.cs
+++ b/MediaBrowser.Server.Implementations/Library/LibraryManager.cs
@@ -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) ?