Skip to content

Commit 08874db

Browse files
Romain GuyAndroid (Google) Code Review
authored andcommitted
Merge "Fix HierarchyViewer so it can load Contacts" into jb-mr1-dev
2 parents 97298cd + 97723b2 commit 08874db

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)