mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-25 15:40:28 +08:00
Check PluginDependency.id on init
This commit is contained in:
parent
f303b0d21a
commit
807df3bbcd
@ -36,6 +36,14 @@ public data class PluginDependency @JvmOverloads constructor(
|
|||||||
*/
|
*/
|
||||||
public val isOptional: Boolean = false
|
public val isOptional: Boolean = false
|
||||||
) {
|
) {
|
||||||
|
init {
|
||||||
|
kotlin.runCatching {
|
||||||
|
PluginDescription.checkPluginId(id)
|
||||||
|
}.getOrElse {
|
||||||
|
throw IllegalArgumentException(it)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see PluginDependency
|
* @see PluginDependency
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user