Replace a deleted comment, check parent is not NULL before using it.

This commit is contained in:
John Scipione 2012-07-25 13:36:30 -04:00
parent 9c5644aa09
commit e06f13f911
2 changed files with 11 additions and 4 deletions

View File

@ -349,6 +349,7 @@ TBarView::MouseDown(BPoint where)
void
TBarView::PlaceDeskbarMenu()
{
// top or bottom, full
if (!fVertical && fBarMenuBar != NULL) {
fBarMenuBar->RemoveSelf();
delete fBarMenuBar;

View File

@ -125,8 +125,12 @@ UpScrollArrow::MouseDown(BPoint where)
if (!IsEnabled())
return;
dynamic_cast<TScrollArrowView*>(Parent())->ScrollBy(-kDefaultScrollStep);
snooze(5000);
TScrollArrowView* parent = dynamic_cast<TScrollArrowView*>(Parent());
if (parent != NULL) {
parent->ScrollBy(-kDefaultScrollStep);
snooze(5000);
}
}
@ -177,8 +181,10 @@ DownScrollArrow::MouseDown(BPoint where)
TScrollArrowView* grandparent
= dynamic_cast<TScrollArrowView*>(Parent()->Parent());
grandparent->ScrollBy(kDefaultScrollStep);
snooze(5000);
if (grandparent != NULL) {
grandparent->ScrollBy(kDefaultScrollStep);
snooze(5000);
}
}