Solved getting ArrayOutOfBoundException when searching contacts with Ctrl-F

git-svn-id: http://svn.igniterealtime.org/svn/repos/spark/trunk@12208 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
Holger Bergunde
2011-03-29 12:26:37 +00:00
committed by holger.bergunde
parent 472a0b650a
commit e9430d589c

View File

@ -62,9 +62,12 @@ public class JContactItemField extends JPanel {
list = new JList(model) {
public String getToolTipText(MouseEvent e) {
int row = locationToIndex(e.getPoint());
final ContactItem item = (ContactItem)getModel().getElementAt(row);
if (item != null) {
return item.getJID();
if (row >= 0)
{
final ContactItem item = (ContactItem)getModel().getElementAt(row);
if (item != null) {
return item.getJID();
}
}
return null;
}