Check PluginDependency.id on init

This commit is contained in:
Him188 2020-09-12 21:22:47 +08:00
parent f303b0d21a
commit 807df3bbcd

View File

@ -36,6 +36,14 @@ public data class PluginDependency @JvmOverloads constructor(
*/
public val isOptional: Boolean = false
) {
init {
kotlin.runCatching {
PluginDescription.checkPluginId(id)
}.getOrElse {
throw IllegalArgumentException(it)
}
}
/**
* @see PluginDependency
*/