Prevent accessing list index when no device is available

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
Maxime “pep” Buquet 2019-02-27 09:24:23 +00:00
parent b5f9eb7e87
commit be9139957c
Signed by: pep
GPG key ID: DEDA74AEECA9D0F2

View file

@ -302,6 +302,8 @@ class XEP_0384(BasePlugin):
self._store_device_ids(bare_jid, items)
items = list(items)
device_ids = []
if items:
device_ids = [int(d['id']) for d in items[0]['devices']]
if bare_jid == self.xmpp.boundjid.bare and \