rem: if (table->clickedRow != row && row >= 0) {
add: if (table->clickedRow != row && row >= 0 && row < table->rows) {
context: static void handleTableEvents(XEvent *event, void *data){    WMTableView *table = (WMTableView*)data;    int row;        switch (event->type) {     case ButtonPress:	if (event->xbutton.button == Button1) {	    row = event->xbutton.y/table->rowHeight;	    if (row != table->clickedRow) {		setRowSelected(table, table->clickedRow, False);	    		setRowSelected(table, row, True);		table->clickedRow = row;	 		table->dragging = 1;	    }	}	break;	     case MotionNotify:	if (table->dragging && event->xmotion.y >= 0) {	    row = event->xmotion.y/table->rowHeight;	    if (table->clickedRow != row && row >= 0) {		setRowSelected(table, table->clickedRow, False);		setRowSelected(table, row, True);		table->clickedRow = row;	    }	}	break;	     case ButtonRelease:	if (event->xbutton.button == Button1) {	    if (table->action)		(*table->action)(table, table->clientData);	    WMPostNotificationName(WMTableViewSelectionDidChangeNotification,				   table, NULL);	    table->dragging = 0;	}	break;     case Expose:	repaintTable(table, event->xexpose.x, event->xexpose.y,		     event->xexpose.width, event->xexpose.height);	break;    }}