From 265302aefec243a8a1f1df220b60098cf402c5e7 Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Tue, 17 Jun 2025 20:51:30 -0400 Subject: [PATCH] BStatusBar: Fix handling of B_COLORS_UPDATED. It didn't check if the message actually contained the status bar color, and if it didn't, we'd wind up with a black color instead. --- src/kits/interface/StatusBar.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/kits/interface/StatusBar.cpp b/src/kits/interface/StatusBar.cpp index 8a43076f42..2966255a1b 100644 --- a/src/kits/interface/StatusBar.cpp +++ b/src/kits/interface/StatusBar.cpp @@ -382,10 +382,11 @@ BStatusBar::MessageReceived(BMessage *message) case B_COLORS_UPDATED: { - // Change the bar color IF we don't have an application-set color. - if ((fInternalFlags & kCustomBarColor) == 0) { - message->FindColor(ui_color_name(B_STATUS_BAR_COLOR), - &fBarColor); + rgb_color color; + if (message->FindColor(ui_color_name(B_STATUS_BAR_COLOR), &color) == B_OK) { + // Change the bar color IF we don't have an application-set color. + if ((fInternalFlags & kCustomBarColor) == 0) + fBarColor = color; } break;