Fix albumNameEnc can be null in Photos (#300)

* Fix proposal for #285

* Update pyicloud/services/photos.py

Co-authored-by: Quentame <polletquentin74@me.com>
This commit is contained in:
jfburdet 2020-09-25 14:00:55 +02:00 committed by GitHub
parent 29bb3678c1
commit e45b6ddf1b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -173,6 +173,11 @@ class PhotosService(object):
} }
for folder in self._fetch_folders(): for folder in self._fetch_folders():
# Skiping albums having null name, that can happen sometime
if "albumNameEnc" not in folder["fields"]:
continue
# TODO: Handle subfolders # pylint: disable=fixme # TODO: Handle subfolders # pylint: disable=fixme
if folder["recordName"] == "----Root-Folder----" or ( if folder["recordName"] == "----Root-Folder----" or (
folder["fields"].get("isDeleted") folder["fields"].get("isDeleted")