From 020f56a07f58782ba5cac61fca4221c313d9d74f Mon Sep 17 00:00:00 2001 From: Michael Lotz Date: Sat, 13 Sep 2008 12:36:17 +0000 Subject: [PATCH] CID 323 and CID 324: Also check the results of these dynamic_casts, sorry for not combining with the previous commit. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27474 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/tests/kits/game/chart/ChartView.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/tests/kits/game/chart/ChartView.cpp b/src/tests/kits/game/chart/ChartView.cpp index 9bcac050de..e7d52c2c14 100644 --- a/src/tests/kits/game/chart/ChartView.cpp +++ b/src/tests/kits/game/chart/ChartView.cpp @@ -27,6 +27,9 @@ void ChartView::Draw(BRect rect) { ChartWindow *window = dynamic_cast(Window()); + if (window == NULL) + return; + if ((window->fOffscreen != 0) && (window->fCurrentSettings.display == DISPLAY_BITMAP)) DrawBitmap(window->fOffscreen, rect, rect); } @@ -58,6 +61,9 @@ void InstantView::Draw(BRect rect) { ChartWindow *window = dynamic_cast(Window()); + if (window == NULL) + return; + for (int32 i = 0; i < window->fInstantLoadLevel; i++) { if (i < step) SetHighColor(255, 90, 90);