if (selectionIndex >= 0 || selectionIndex < (list.count() - 1)) {
if (selectionIndex >= 0 && selectionIndex < list.count()) {
  public WOActionResults invokeAction(WORequest request, WOContext context) {    WOActionResults results = null;    if (context.elementID().equals(context.senderID())) {      String message = context.request().stringFormValueForKey(InstantMessengerAdaptor.MESSAGE_KEY);      NSArray list = (NSArray) valueForBinding("list");      NSArray selectedObjects;      Object selectedObject;      if (ERXStringUtilities.isDigitsOnly(message)) {        int selectionIndex = Integer.parseInt(message) - 1;        if (selectionIndex >= 0 || selectionIndex < (list.count() - 1)) {          selectedObject = list.objectAtIndex(selectionIndex);          selectedObjects = new NSArray(selectedObject);        }        else {          selectedObject = null;          selectedObjects = NSArray.EmptyArray;        }      }      else {        String displayStringKeyPath = (String) valueForBinding("displayStringKeyPath");        Boolean quicksilverBoolean = (Boolean) valueForBinding("quicksilver");        boolean quicksilver = (quicksilverBoolean != null && quicksilverBoolean.booleanValue());        selectedObjects = IMSearchOptionsAction.selectedValues(list, displayStringKeyPath, quicksilver, message);        if (selectedObjects.count() == 1) {          selectedObject = selectedObjects.objectAtIndex(0);        }        else {          selectedObject = null;        }      }      boolean selectionBound = canSetValueForBinding("selection");      if (canSetValueForBinding("selections")) {        setValueForBinding(selectedObjects, "selections");      }      if (canSetValueForBinding("selection")) {        setValueForBinding(selectedObject, "selection");      }      results = (WOActionResults) valueForBinding("action");    }    return results;  }