Prevent accessing list index when no device is available also in _store_device_ids

Signed-off-by: Maxime Buquet's avatarMaxime “pep” Buquet <>
parent 7449e5c9
......@@ -286,7 +286,8 @@ class XEP_0384(BasePlugin):
"""Store Device list"""
device_ids = [] # type: List[int]
items = list(items)
device_ids = [int(d['id']) for d in items[0]['devices']]
if items:
device_ids = [int(d['id']) for d in items[0]['devices']]
return self._omemo.newDeviceList(str(jid), device_ids)
def _receive_device_list(self, msg: Message) -> None:
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment