Add check: ForwardMessage.nodeList mustn't be empty

This commit is contained in:
Him188 2020-04-25 12:34:39 +08:00
parent 6a631418d2
commit 48362a241c

View File

@ -84,6 +84,12 @@ class ForwardMessage @JvmOverloads constructor(
val nodeList: Collection<INode>,
val displayStrategy: DisplayStrategy = DisplayStrategy
) : MessageContent {
init {
require(nodeList.isNotEmpty()) {
"Forward nodeList mustn't be empty"
}
}
/**
* @see ForwardMessage
*/