primitivus: disconnected contact crash fix

fix IndexError when selecting a contact and hiding disconnected ones
fix bug 47
This commit is contained in:
Goffi 2013-09-22 01:49:19 +02:00
commit e3286d5554

View file

@ -50,7 +50,10 @@ class ContactList(urwid.WidgetWrap, QuickContactList):
widget, position = self.frame.body.get_focus()
self.frame.body = self.__buildList()
if position:
self.frame.body.set_focus(position)
try:
self.frame.body.set_focus(position)
except IndexError:
pass
self.host.redraw()
def update_jid(self, jid):