From 70b299d5eb39c83ea3970a4d537e760edc8b079d Mon Sep 17 00:00:00 2001 From: codeskyblue Date: Mon, 13 May 2024 19:39:52 +0800 Subject: [PATCH] catch error to quickly fix --- .../uiautomator/stub/AccessibilityNodeInfoDumper.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/src/androidTest/java/com/github/uiautomator/stub/AccessibilityNodeInfoDumper.java b/app/src/androidTest/java/com/github/uiautomator/stub/AccessibilityNodeInfoDumper.java index c235e0e..380069a 100644 --- a/app/src/androidTest/java/com/github/uiautomator/stub/AccessibilityNodeInfoDumper.java +++ b/app/src/androidTest/java/com/github/uiautomator/stub/AccessibilityNodeInfoDumper.java @@ -45,8 +45,13 @@ public static void dumpWindowHierarchy(UiDevice device, OutputStream out) throws serializer.attribute("", "rotation", Integer.toString(device.getDisplayRotation())); for (AccessibilityNodeInfo root : getWindowRoots(device)) { - dumpNodeRec(root, serializer, 0, device.getDisplayWidth(), - device.getDisplayHeight()); + try { + dumpNodeRec(root, serializer, 0, device.getDisplayWidth(), + device.getDisplayHeight()); + } catch (IllegalArgumentException e) { + // java.lang.IllegalArgumentException: Illegal character (U+0) + e.printStackTrace(); + } } serializer.endTag("", "hierarchy");