moved the NULL check before dereferencing the view pointer. CID 1063

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27525 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stefano Ceccherini 2008-09-15 12:44:07 +00:00
parent a57b0996eb
commit 0bec71008b
1 changed files with 4 additions and 3 deletions

View File

@ -1365,9 +1365,10 @@ TReplicantTray::RealignReplicants(int32 startIndex)
BView *view = NULL; BView *view = NULL;
for (int32 i = startIndex ; i < count ; i++){ for (int32 i = startIndex ; i < count ; i++){
fShelf->ReplicantAt(i, &view); fShelf->ReplicantAt(i, &view);
BPoint loc = LocationForReplicant(i, view->Frame().Width()); if (view != NULL) {
if (view && (view->Frame().LeftTop() != loc)) { BPoint loc = LocationForReplicant(i, view->Frame().Width());
view->MoveTo(loc); if (view->Frame().LeftTop() != loc)
view->MoveTo(loc);
} }
} }
} }