libtracker: avoid Tracker crash while changing resolutions.

After settings Backgrounds to None for all worskapces, I was getting a 100%
reproducible segment violation on "fShowingBitmap->fBitmap->Bounds()" with every
resolution change.

Change-Id: I2a3640a3c33e571d772c1b38b21087346215dca8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8176
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
This commit is contained in:
Oscar Lesta 2024-09-02 06:21:52 -03:00 committed by waddlesplash
parent c9ce7be28c
commit 12aa283408

View File

@ -356,7 +356,7 @@ BackgroundImage::WorkspaceActivated(BView* view, int32 workspace, bool state)
void
BackgroundImage::ScreenChanged(BRect, color_space)
{
if (!fIsDesktop || fShowingBitmap == NULL)
if (!fIsDesktop || fShowingBitmap == NULL || fShowingBitmap->fBitmap == NULL)
return;
if (fShowingBitmap->fMode == kCentered) {