Prevent accessing list index when no device is available also in _store_device_ids
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
parent
7449e5c908
commit
4da2bf06e9
1 changed files with 2 additions and 1 deletions
|
@ -286,6 +286,7 @@ class XEP_0384(BasePlugin):
|
||||||
"""Store Device list"""
|
"""Store Device list"""
|
||||||
device_ids = [] # type: List[int]
|
device_ids = [] # type: List[int]
|
||||||
items = list(items)
|
items = list(items)
|
||||||
|
if items:
|
||||||
device_ids = [int(d['id']) for d in items[0]['devices']]
|
device_ids = [int(d['id']) for d in items[0]['devices']]
|
||||||
return self._omemo.newDeviceList(str(jid), device_ids)
|
return self._omemo.newDeviceList(str(jid), device_ids)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue