Skip to content

Commit d170bf6

Browse files
committed
fix: index out of range exception when trying to get friendly name of upstream
Signed-off-by: leo <[email protected]>
1 parent d7ce010 commit d170bf6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Converters/StringConverters.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,6 @@ public object ConvertBack(object value, Type targetType, object parameter, Cultu
8686
new FuncValueConverter<string, bool>(v => v != null && v.Trim().Length > 0);
8787

8888
public static readonly FuncValueConverter<string, string> ToFriendlyUpstream =
89-
new FuncValueConverter<string, string>(v => v != null ? v.Substring(13) : string.Empty);
89+
new FuncValueConverter<string, string>(v => v is { Length: > 13 } ? v.Substring(13) : string.Empty);
9090
}
9191
}

0 commit comments

Comments
 (0)