mirror of
https://github.com/mamoe/mirai.git
synced 2025-03-03 15:10:14 +08:00
Check passwordMd5 on BotAccount init
This commit is contained in:
parent
ff5db553de
commit
96c7b51094
@ -12,6 +12,7 @@ package net.mamoe.mirai.internal
|
||||
|
||||
import net.mamoe.mirai.utils.MiraiExperimentalApi
|
||||
import net.mamoe.mirai.utils.md5
|
||||
import net.mamoe.mirai.utils.toUHexString
|
||||
|
||||
internal data class BotAccount(
|
||||
@JvmSynthetic
|
||||
@ -22,6 +23,12 @@ internal data class BotAccount(
|
||||
|
||||
val phoneNumber: String = ""
|
||||
) {
|
||||
init {
|
||||
check(passwordMd5.size == 16) {
|
||||
"Invalid passwordMd5: size must be 16 but got ${passwordMd5.size}. passwordMd5=${passwordMd5.toUHexString()}"
|
||||
}
|
||||
}
|
||||
|
||||
constructor(id: Long, passwordPlainText: String, phoneNumber: String = "") : this(
|
||||
id,
|
||||
passwordPlainText.md5(),
|
||||
|
Loading…
Reference in New Issue
Block a user