Only call dump when a ViewRoot actually exists

Bug: 11446494
Change-Id: I47e35d7b4d49d6893ba0c9f8ad05b31f91be85d2
This commit is contained in:
Michael Wright
2013-11-01 12:42:49 -07:00
parent c779c01ecc
commit 5f48dc7409

View File

@@ -4857,7 +4857,11 @@ public class Activity extends ContextThemeWrapper
mFragments.dump(prefix, fd, writer, args);
getWindow().getDecorView().getViewRootImpl().dump(prefix, fd, writer, args);
if (getWindow() != null &&
getWindow().peekDecorView() != null &&
getWindow().peekDecorView().getViewRootImpl() != null) {
getWindow().peekDecorView().getViewRootImpl().dump(prefix, fd, writer, args);
}
mHandler.getLooper().dump(new PrintWriterPrinter(writer), prefix);
}