Prevent accessing list index when no device is available
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
parent
b5f9eb7e87
commit
be9139957c
1 changed files with 3 additions and 1 deletions
|
@ -302,7 +302,9 @@ class XEP_0384(BasePlugin):
|
||||||
self._store_device_ids(bare_jid, items)
|
self._store_device_ids(bare_jid, items)
|
||||||
|
|
||||||
items = list(items)
|
items = list(items)
|
||||||
device_ids = [int(d['id']) for d in items[0]['devices']]
|
device_ids = []
|
||||||
|
if items:
|
||||||
|
device_ids = [int(d['id']) for d in items[0]['devices']]
|
||||||
|
|
||||||
if bare_jid == self.xmpp.boundjid.bare and \
|
if bare_jid == self.xmpp.boundjid.bare and \
|
||||||
self._device_id not in device_ids:
|
self._device_id not in device_ids:
|
||||||
|
|
Loading…
Reference in a new issue