rem: assert(lPtr->selectedItem < WMGetBagItemCount(lPtr->items));
add: assert(lPtr->selectedItem < WMGetArrayItemCount(lPtr->items));
context: WMSelectListItem(WMList *lPtr, int row){    WMListItem *itemPtr;    int notify = 0;    if (row >= WMGetBagItemCount(lPtr->items))	return;    /* the check below must be changed when the multiple selection is     * implemented. -Dan     */    if (!lPtr->flags.allowMultipleSelection && row == lPtr->selectedItem)        notify = 0;    else        notify = 1;    assert(lPtr->selectedItem < WMGetBagItemCount(lPtr->items));        if (!lPtr->flags.allowMultipleSelection) {	/* unselect previous selected item */	if (lPtr->selectedItem >= 0) {	    itemPtr = WMGetFromBag(lPtr->items, lPtr->selectedItem);	    if (itemPtr->selected) {		itemPtr->selected = 0;		if (lPtr->view->flags.mapped 		    && lPtr->selectedItem>=lPtr->topItem		    && lPtr->selectedItem<=lPtr->topItem+lPtr->fullFitLines) {		    paintItem(lPtr, lPtr->selectedItem);		}	    }	}    }        if (row < 0) {        if (!lPtr->flags.allowMultipleSelection) {	    lPtr->selectedItem = -1;            if (notify)                WMPostNotificationName(WMListSelectionDidChangeNotification,                                       lPtr, (void*)((int)lPtr->selectedItem));        }	return;    }    /* select item */    itemPtr = WMGetFromBag(lPtr->items, row);    if (lPtr->flags.allowMultipleSelection)	itemPtr->selected = !itemPtr->selected;    else	itemPtr->selected = 1;    if (lPtr->view->flags.mapped) {	paintItem(lPtr, row);	if ((row-lPtr->topItem+lPtr->fullFitLines)*lPtr->itemHeight	    > lPtr->view->size.height-2)	    W_DrawRelief(lPtr->view->screen, lPtr->view->window, 0, 0,			 lPtr->view->size.width, lPtr->view->size.height,			 WRSunken);    }    lPtr->selectedItem = row;    if (notify)        WMPostNotificationName(WMListSelectionDidChangeNotification, lPtr,                               (void*)((int)lPtr->selectedItem));}