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

View File

@ -982,16 +982,19 @@ ServerWindow::_DispatchMessage(int32 code, BPrivate::LinkReceiver &link)
rgb_color c;
link.Read(&c, sizeof(rgb_color));
myRootLayer->Lock();
if (myRootLayer)
myRootLayer->Lock();
fCurrentLayer->SetViewColor(RGBColor(c));
#ifndef NEW_CLIPPING
if (myRootLayer)
myRootLayer->GoRedraw(fCurrentLayer, fCurrentLayer->fVisible);
#else
myRootLayer->GoRedraw(fCurrentLayer, fCurrentLayer->VisibleRegion());
if (myRootLayer)
myRootLayer->GoRedraw(fCurrentLayer, fCurrentLayer->VisibleRegion());
#endif
myRootLayer->Unlock();
if (myRootLayer)
myRootLayer->Unlock();
break;
}