fix: index out of range exception when trying to get friendly name of upstream

Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
leo
2025-07-25 17:15:47 +08:00
parent d7ce01072b
commit d170bf6499

View File

@@ -86,6 +86,6 @@ namespace SourceGit.Converters
new FuncValueConverter<string, bool>(v => v != null && v.Trim().Length > 0);
public static readonly FuncValueConverter<string, string> ToFriendlyUpstream =
new FuncValueConverter<string, string>(v => v != null ? v.Substring(13) : string.Empty);
new FuncValueConverter<string, string>(v => v is { Length: > 13 } ? v.Substring(13) : string.Empty);
}
}