fix(Wework): Ensure non-null message handling in reply logic

Updated the WeworkController and WeworkOperationImpl to enforce non-null checks for message content and text type during reply operations. This change prevents potential null pointer exceptions and enhances the reliability of the message handling process.
This commit is contained in:
2026-03-25 17:44:17 +08:00
parent 4cf0c273b5
commit ffb61e062e
2 changed files with 12 additions and 10 deletions

View File

@@ -76,7 +76,7 @@ object WeworkController {
message, message,
message.titleList, message.titleList,
lastReceivedName, lastReceivedName,
lastReceivedMessage, lastReceivedMessage!!,
null, null,
message.receivedContent message.receivedContent
) )

View File

@@ -114,7 +114,7 @@ object WeworkOperationImpl {
titleList: List<String>, titleList: List<String>,
receivedName: String?, receivedName: String?,
originalContent: String, originalContent: String,
textType: Int, textType: Int?,
receivedContent: String? receivedContent: String?
): Boolean { ): Boolean {
val startTime = System.currentTimeMillis() val startTime = System.currentTimeMillis()
@@ -145,14 +145,16 @@ object WeworkOperationImpl {
val failList = arrayListOf<String>() val failList = arrayListOf<String>()
for (title in LinkedHashSet(titleList)) { for (title in LinkedHashSet(titleList)) {
if (WeworkRoomUtil.intoRoom(title) || WeworkRoomUtil.intoRoom(title, fastIn = false)) { if (WeworkRoomUtil.intoRoom(title) || WeworkRoomUtil.intoRoom(title, fastIn = false)) {
if (WeworkTextUtil.longClickMessageItem( if (textType?.let {
//聊天消息列表 1ListView 0RecycleView xViewGroup WeworkTextUtil.longClickMessageItem(
AccessibilityUtil.findOneByClazz(getRoot(), Views.ListView), //聊天消息列表 1ListView 0RecycleView xViewGroup
textType, AccessibilityUtil.findOneByClazz(getRoot(), Views.ListView),
receivedName, it,
originalContent, receivedName,
"回复", "引用" originalContent,
) "回复", "引用"
)
} == true
) { ) {
LogUtils.v("开始回复") LogUtils.v("开始回复")
if (sendChatMessage(receivedContent, reply = true, title = title)) { if (sendChatMessage(receivedContent, reply = true, title = title)) {