From e45b6ddf1b4b2ee1d85fa76a330298975511f3eb Mon Sep 17 00:00:00 2001 From: jfburdet Date: Fri, 25 Sep 2020 14:00:55 +0200 Subject: [PATCH] Fix albumNameEnc can be null in Photos (#300) * Fix proposal for #285 * Update pyicloud/services/photos.py Co-authored-by: Quentame --- pyicloud/services/photos.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pyicloud/services/photos.py b/pyicloud/services/photos.py index 30510ab..9df8314 100644 --- a/pyicloud/services/photos.py +++ b/pyicloud/services/photos.py @@ -173,6 +173,11 @@ class PhotosService(object): } 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 if folder["recordName"] == "----Root-Folder----" or ( folder["fields"].get("isDeleted")