mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-05-31 21:08:27 +01:00
Fix IndexOutOfRangeException
Fixes situations where the filename is something like "-------".
This commit is contained in:
@@ -923,14 +923,14 @@ namespace MediaBrowser.Server.Implementations.Library
|
|||||||
|
|
||||||
if (type == typeof(Person))
|
if (type == typeof(Person))
|
||||||
{
|
{
|
||||||
var subFolderIndex = 0;
|
foreach (char c in validFilename)
|
||||||
|
|
||||||
while (!char.IsLetterOrDigit(validFilename[subFolderIndex]))
|
|
||||||
{
|
{
|
||||||
subFolderIndex++;
|
if (char.IsLetterOrDigit(c))
|
||||||
|
{
|
||||||
|
subFolderPrefix = c.ToString();
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
subFolderPrefix = validFilename.Substring(subFolderIndex, 1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var fullPath = string.IsNullOrEmpty(subFolderPrefix) ?
|
var fullPath = string.IsNullOrEmpty(subFolderPrefix) ?
|
||||||
|
|||||||
Reference in New Issue
Block a user