Fix #550: NoSuchElementException when concatenating an EmptyMessageChain with another
This commit is contained in:
Him188 2020-09-01 20:09:28 +08:00 committed by GitHub
commit 89974923f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -178,7 +178,9 @@ internal fun Message.followedByImpl(tail: Message): MessageChain {
} else if (!tailUsed) {
tailUsed = true
iterator = tail.iterator()
iterator.next()
if (iterator.hasNext()) {
iterator.next()
} else null
} else null
}
)