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,7 +286,8 @@ 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)
|
||||||
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)
|
return self._omemo.newDeviceList(str(jid), device_ids)
|
||||||
|
|
||||||
def _receive_device_list(self, msg: Message) -> None:
|
def _receive_device_list(self, msg: Message) -> None:
|
||||||
|
|
Loading…
Reference in a new issue