Skip to content

Commit c5493c3

Browse files
committed
🐛 fix StringIndexOutOfBoundsException
1 parent e653eed commit c5493c3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/kotlin/xyz/xasmc/hashbook/util/MessageUtil.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ object MessageUtil {
2424
}
2525

2626
fun shortHashMessage(hash: String): String {
27-
val shortHash = hash.substring(0..6)
27+
val shortHash = hash.substring(0..6.coerceAtMost(hash.length))
2828
return copyMsg("$shortHash <i><gold>[点击复制]</gold></i>", hash, "<green>$hash</green>")
2929
}
3030

0 commit comments

Comments
 (0)