aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCody Robibero <cody@robibe.ro>2021-12-11 20:35:43 -0700
committerCody Robibero <cody@robibe.ro>2021-12-11 20:35:43 -0700
commita04f8f5efb3f067de2ce27e8804aab5c950ac284 (patch)
tree37274dc2038dbe79bf04d39b4f0f0805066335ee
parent58f788e8abfce620db5a9b70165ff6cbe0931a46 (diff)
Fix new test
-rw-r--r--Emby.Server.Implementations/Library/PathExtensions.cs3
1 files changed, 2 insertions, 1 deletions
diff --git a/Emby.Server.Implementations/Library/PathExtensions.cs b/Emby.Server.Implementations/Library/PathExtensions.cs
index 3fcbb4d65..6f61dc713 100644
--- a/Emby.Server.Implementations/Library/PathExtensions.cs
+++ b/Emby.Server.Implementations/Library/PathExtensions.cs
@@ -40,7 +40,8 @@ namespace Emby.Server.Implementations.Library
&& str[attributeEnd] == '=')
{
var closingIndex = str[attributeEnd..].IndexOf(']');
- if (closingIndex != -1)
+ // Must be at least 1 character before the closing bracket.
+ if (closingIndex > 1)
{
return str[(attributeEnd + 1)..(attributeEnd + closingIndex)].Trim().ToString();
}