noticed some weird exceptions, which I have no idea how they can happen

This commit is contained in:
13xforever 2022-08-09 17:18:07 +05:00
parent 960ddb9fe6
commit 1045211985

View File

@ -8,8 +8,11 @@ public static class Utils
private const long UnderMB = 1000 * 1024;
private const long UnderGB = 1000 * 1024 * 1024;
public static string Trim(this string str, int maxLength)
public static string Trim(this string? str, int maxLength)
{
if (str is null)
return "";
if (str.Length > maxLength)
return str[..(maxLength - 1)] + "…";