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