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 2ff84c5 commit 828566a
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..hash.length.coerceAtMost(6))
val shortHash = hash.substring(0..6.coerceAtMost(hash.length - 1))
return copyMsg("$shortHash <i><gold>[点击复制]</gold></i>", hash, "<green>$hash</green>")
}

Expand Down

0 comments on commit 828566a

Please sign in to comment.