Skip to content

Commit 97723b2

Browse files
author
Romain Guy
committed
Fix HierarchyViewer so it can load Contacts
Change-Id: I5d5f400a9283f9c2431d91a10f85be42b02fe6a0
1 parent 4b41688 commit 97723b2

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

core/java/android/view/ViewDebug.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1178,10 +1178,14 @@ static Object resolveId(Context context, int id) {
11781178

11791179
private static void writeValue(BufferedWriter out, Object value) throws IOException {
11801180
if (value != null) {
1181-
String output = value.toString().replace("\n", "\\n");
1182-
out.write(String.valueOf(output.length()));
1183-
out.write(",");
1184-
out.write(output);
1181+
String output = "[EXCEPTION]";
1182+
try {
1183+
output = value.toString().replace("\n", "\\n");
1184+
} finally {
1185+
out.write(String.valueOf(output.length()));
1186+
out.write(",");
1187+
out.write(output);
1188+
}
11851189
} else {
11861190
out.write("4,null");
11871191
}

0 commit comments

Comments
 (0)