plugin XEP-0048: don't fail if a type is missing in bookmark data.
This commit is contained in:
parent
a6059161bb
commit
1c1f617cdf
1 changed files with 7 additions and 1 deletions
|
|
@ -443,7 +443,13 @@ class XEP_0048(object):
|
|||
bookmarks_ori = getattr(client, "bookmarks_" + _storage_location)
|
||||
if bookmarks_ori is None:
|
||||
return ret
|
||||
data = bookmarks_ori[type_]
|
||||
try:
|
||||
data = bookmarks_ori[type_]
|
||||
except KeyError:
|
||||
log.warning(
|
||||
f"{type_!r} missing in {storage_location} storage."
|
||||
)
|
||||
data = bookmarks_ori[type_] = {}
|
||||
for bookmark in data:
|
||||
if type_ == XEP_0048.MUC_TYPE:
|
||||
ret[_storage_location][bookmark.full()] = data[bookmark].copy()
|
||||
|
|
|
|||
Loading…
Reference in a new issue