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

This commit is contained in:
John Scipione
2012-11-12 22:03:20 -05:00
parent 9c5644aa09
commit e06f13f911
2 changed files with 11 additions and 4 deletions
+1
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;
+10 -4
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);
}
}