diff --git a/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/ForwardMessage.kt b/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/ForwardMessage.kt index c9c7879c1..bd1f31efe 100644 --- a/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/ForwardMessage.kt +++ b/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/ForwardMessage.kt @@ -84,6 +84,12 @@ class ForwardMessage @JvmOverloads constructor( val nodeList: Collection, val displayStrategy: DisplayStrategy = DisplayStrategy ) : MessageContent { + init { + require(nodeList.isNotEmpty()) { + "Forward nodeList mustn't be empty" + } + } + /** * @see ForwardMessage */