Skip to content

Commit f875f90

Browse files
committed
fix: 修复拓展方法AccessibilityNodeInfo.findByTags参数空字符串时节点筛选空问题
1 parent 47f2ddb commit f875f90

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

assists/src/main/java/com/ven/assists/AssistsCore.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,7 @@ object AssistsCore {
385385
}
386386
}
387387
nodeList = viewId?.let {
388+
if (it.isEmpty())return@let nodeList
388389
return@let arrayListOf<AccessibilityNodeInfo>().apply {
389390
addAll(nodeList.filter {
390391
return@filter it.viewIdResourceName == viewId
@@ -395,13 +396,15 @@ object AssistsCore {
395396
}
396397

397398
nodeList = text?.let {
399+
if (it.isEmpty())return@let nodeList
398400
return@let arrayListOf<AccessibilityNodeInfo>().apply {
399401
addAll(nodeList.filter {
400402
return@filter it.txt() == text
401403
})
402404
}
403405
} ?: let { return@let nodeList }
404406
nodeList = des?.let {
407+
if (it.isEmpty())return@let nodeList
405408
return@let arrayListOf<AccessibilityNodeInfo>().apply {
406409
addAll(nodeList.filter {
407410
return@filter it.des() == des

0 commit comments

Comments
 (0)