fix crash in Invoke() when no items are selected and a selection change message is set

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15620 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus 2005-12-20 22:17:07 +00:00
parent d69c048704
commit 46128d7e26

View File

@ -836,9 +836,11 @@ BListView::Invoke(BMessage *message)
if (fListType == B_SINGLE_SELECTION_LIST) if (fListType == B_SINGLE_SELECTION_LIST)
clone.AddInt32("index", fFirstSelected); clone.AddInt32("index", fFirstSelected);
else { else {
for (int32 i = fFirstSelected; i <= fLastSelected; i++) { if (fFirstSelected >= 0) {
if (ItemAt(i)->IsSelected()) for (int32 i = fFirstSelected; i <= fLastSelected; i++) {
clone.AddInt32("index", i); if (ItemAt(i)->IsSelected())
clone.AddInt32("index", i);
}
} }
} }