From ec130eefb6593526ca554818a36d49830a469214 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Thu, 18 Aug 2005 00:05:37 +0000 Subject: [PATCH] TBarMenuTitle::DrawContents() now checks if there is a logo before trying to draw it. This fixes the crashing bug when being compiled from Zeta (because of the different message storage format) - debugged under Haiku thanks to Ingo's great work :-) git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13969 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/deskbar/BarMenuTitle.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/apps/deskbar/BarMenuTitle.cpp b/src/apps/deskbar/BarMenuTitle.cpp index 6651e4b5fa..90e5150105 100644 --- a/src/apps/deskbar/BarMenuTitle.cpp +++ b/src/apps/deskbar/BarMenuTitle.cpp @@ -137,12 +137,14 @@ TBarMenuTitle::DrawContent() menu->SetDrawingMode(B_OP_ALPHA); - BRect dstRect(fIcon->Bounds()); - dstRect.OffsetTo(frame.LeftTop()); - dstRect.OffsetBy(rintf(((frame.Width() - dstRect.Width()) / 2) - 1.0f), - rintf(((frame.Height() - dstRect.Height()) / 2) - 0.0f)); + if (fIcon != NULL) { + BRect dstRect(fIcon->Bounds()); + dstRect.OffsetTo(frame.LeftTop()); + dstRect.OffsetBy(rintf(((frame.Width() - dstRect.Width()) / 2) - 1.0f), + rintf(((frame.Height() - dstRect.Height()) / 2) - 0.0f)); - menu->DrawBitmapAsync(fIcon, dstRect); + menu->DrawBitmapAsync(fIcon, dstRect); + } }