Skip to content

Commit

Permalink
🐛 fix StringIndexOutOfBoundsException
Browse files Browse the repository at this point in the history
  • Loading branch information
XiYang6666 committed Jun 8, 2024
1 parent e653eed commit c5493c3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/kotlin/xyz/xasmc/hashbook/util/MessageUtil.kt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ object MessageUtil {
}

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

Expand Down

0 comments on commit c5493c3

Please sign in to comment.