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 void
TBarView::PlaceDeskbarMenu() TBarView::PlaceDeskbarMenu()
{ {
// top or bottom, full
if (!fVertical && fBarMenuBar != NULL) { if (!fVertical && fBarMenuBar != NULL) {
fBarMenuBar->RemoveSelf(); fBarMenuBar->RemoveSelf();
delete fBarMenuBar; delete fBarMenuBar;

View File

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