Fix QuoteReply without msgHead, fix #1641

This commit is contained in:
Karlatemp 2021-11-06 23:20:48 +08:00
parent c56708ca7f
commit 69931538f5
No known key found for this signature in database
GPG Key ID: 21FBDDF664FF06F8

View File

@ -168,7 +168,9 @@ internal fun OfflineMessageSourceImplData(
targetId = when {
groupIdOrZero != 0L -> groupIdOrZero
delegate.toUin != 0L -> delegate.toUin
delegate.srcMsg != null -> delegate.srcMsg.loadAs(MsgComm.Msg.serializer()).msgHead.toUin
delegate.srcMsg != null -> runCatching {
delegate.srcMsg.loadAs(MsgComm.Msg.serializer()).msgHead.toUin
}.getOrElse { 0L }
else -> 0/*error("cannot find targetId. delegate=${delegate._miraiContentToString()}, delegate.srcMsg=${
kotlin.runCatching { delegate.srcMsg?.loadAs(MsgComm.Msg.serializer())?._miraiContentToString() }
.fold(