Skip to content
This repository has been archived by the owner on Jun 13, 2022. It is now read-only.

Commit

Permalink
fix: potential exception
Browse files Browse the repository at this point in the history
  • Loading branch information
xjasonlyu committed May 23, 2021
1 parent c926a77 commit 843463e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Jellyfin.Plugin.AVDC/Providers/BaseProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ private static string ExtractExternalId(string s)
.Replace("item_", string.Empty)
.Replace(".html", string.Empty);

return s.Substring(s.LastIndexOf('/')).TrimStart('/');
return s.LastIndexOf('/') > 0 ? s.Substring(s.LastIndexOf('/')).TrimEnd('/') : s;
}

private static string[] ProviderNames => typeof(Constant).GetFields(BindingFlags.Public | BindingFlags.Static)
Expand Down

0 comments on commit 843463e

Please sign in to comment.