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.
This commit is contained in:
Augustin Cavalier
2025-06-17 20:51:30 -04:00
parent 8de71284ed
commit 265302aefe
+5 -4
View File
@@ -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;