From e06f13f9110879dca0e2338266c20e6f44f14d1c Mon Sep 17 00:00:00 2001 From: John Scipione Date: Wed, 25 Jul 2012 13:36:30 -0400 Subject: [PATCH] Replace a deleted comment, check parent is not NULL before using it. --- src/apps/deskbar/BarView.cpp | 1 + src/apps/deskbar/ScrollArrowView.cpp | 14 ++++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/apps/deskbar/BarView.cpp b/src/apps/deskbar/BarView.cpp index e08d6d8114..a966e47006 100644 --- a/src/apps/deskbar/BarView.cpp +++ b/src/apps/deskbar/BarView.cpp @@ -349,6 +349,7 @@ TBarView::MouseDown(BPoint where) void TBarView::PlaceDeskbarMenu() { + // top or bottom, full if (!fVertical && fBarMenuBar != NULL) { fBarMenuBar->RemoveSelf(); delete fBarMenuBar; diff --git a/src/apps/deskbar/ScrollArrowView.cpp b/src/apps/deskbar/ScrollArrowView.cpp index 707a8600ef..39497299c3 100644 --- a/src/apps/deskbar/ScrollArrowView.cpp +++ b/src/apps/deskbar/ScrollArrowView.cpp @@ -125,8 +125,12 @@ UpScrollArrow::MouseDown(BPoint where) if (!IsEnabled()) return; - dynamic_cast(Parent())->ScrollBy(-kDefaultScrollStep); - snooze(5000); + TScrollArrowView* parent = dynamic_cast(Parent()); + + if (parent != NULL) { + parent->ScrollBy(-kDefaultScrollStep); + snooze(5000); + } } @@ -177,8 +181,10 @@ DownScrollArrow::MouseDown(BPoint where) TScrollArrowView* grandparent = dynamic_cast(Parent()->Parent()); - grandparent->ScrollBy(kDefaultScrollStep); - snooze(5000); + if (grandparent != NULL) { + grandparent->ScrollBy(kDefaultScrollStep); + snooze(5000); + } }