myRootLayer can be NULL for offscreen bitmaps, fixes crash on Media preferences

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14711 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Jérôme Duval
2005-11-04 22:48:51 +00:00
parent 9ae89b4535
commit 428ebf6d5f
+3
View File
@@ -982,6 +982,7 @@ ServerWindow::_DispatchMessage(int32 code, BPrivate::LinkReceiver &link)
rgb_color c; rgb_color c;
link.Read(&c, sizeof(rgb_color)); link.Read(&c, sizeof(rgb_color));
if (myRootLayer)
myRootLayer->Lock(); myRootLayer->Lock();
fCurrentLayer->SetViewColor(RGBColor(c)); fCurrentLayer->SetViewColor(RGBColor(c));
@@ -989,8 +990,10 @@ myRootLayer->Lock();
if (myRootLayer) if (myRootLayer)
myRootLayer->GoRedraw(fCurrentLayer, fCurrentLayer->fVisible); myRootLayer->GoRedraw(fCurrentLayer, fCurrentLayer->fVisible);
#else #else
if (myRootLayer)
myRootLayer->GoRedraw(fCurrentLayer, fCurrentLayer->VisibleRegion()); myRootLayer->GoRedraw(fCurrentLayer, fCurrentLayer->VisibleRegion());
#endif #endif
if (myRootLayer)
myRootLayer->Unlock(); myRootLayer->Unlock();
break; break;
} }