Bug 847002 - Guard against going into codepaths that assume GetLayerManager doesn't return null. r=Cwiiis

This commit is contained in:
Kartikaya Gupta 2013-03-14 12:17:49 +01:00
parent 9e1ff5daa6
commit f17356ad95

View File

@ -939,7 +939,7 @@ bool
nsWindow::DrawTo(gfxASurface *targetSurface, const nsIntRect &invalidRect)
{
mozilla::layers::RenderTraceScope trace("DrawTo", "717171");
if (!mIsVisible || !mWidgetListener)
if (!mIsVisible || !mWidgetListener || !GetLayerManager(nullptr))
return false;
nsRefPtr<nsWindow> kungFuDeathGrip(this);
@ -2328,7 +2328,7 @@ nsWindow::WidgetPaintsBackground()
bool
nsWindow::NeedsPaint()
{
if (sCompositorPaused || FindTopLevel() != nsWindow::TopWindow()) {
if (sCompositorPaused || FindTopLevel() != nsWindow::TopWindow() || !GetLayerManager(nullptr)) {
return false;
}
return nsIWidget::NeedsPaint();