Bug 1386477 - Add nullptr check for layerManager->GetRoot() to prevent crash when dumping display list data. r=kats
MozReview-Commit-ID: 6o0PwKvs0HQ
--- a/layout/base/nsLayoutUtils.cpp
+++ b/layout/base/nsLayoutUtils.cpp
@@ -3788,17 +3788,19 @@ nsLayoutUtils::PaintFrame(gfxContext* aR
if (gfxEnv::DumpPaintToFile()) {
fclose(gfxUtils::sDumpPaintFile);
}
gfxUtils::sDumpPaintFile = savedDumpFile;
#endif
std::stringstream lsStream;
nsFrame::PrintDisplayList(&builder, list, lsStream);
- layerManager->GetRoot()->SetDisplayListLog(lsStream.str().c_str());
+ if (layerManager->GetRoot()) {
+ layerManager->GetRoot()->SetDisplayListLog(lsStream.str().c_str());
+ }
}
#ifdef MOZ_DUMP_PAINTING
if (gfxPrefs::DumpClientLayers()) {
std::stringstream ss;
FrameLayerBuilder::DumpRetainedLayerTree(layerManager, ss, false);
print_stderr(ss);
}