Merge "Fix NPE in DropBoxManagerService.dump()" into lmp-mr1-dev

This commit is contained in:
Jeff Sharkey
2014-11-14 21:06:20 +00:00
committed by Android (Google) Code Review

View File

@@ -408,9 +408,14 @@ public final class DropBoxManagerService extends IDropBoxManagerService.Stub {
if (!newline) out.append("\n"); if (!newline) out.append("\n");
} else { } else {
String text = dbe.getText(70); String text = dbe.getText(70);
boolean truncated = (text.length() == 70); out.append(" ");
out.append(" ").append(text.trim().replace('\n', '/')); if (text == null) {
if (truncated) out.append(" ..."); out.append("[null]");
} else {
boolean truncated = (text.length() == 70);
out.append(text.trim().replace('\n', '/'));
if (truncated) out.append(" ...");
}
out.append("\n"); out.append("\n");
} }
} catch (IOException e) { } catch (IOException e) {