diff --git a/radicale/__init__.py b/radicale/__init__.py index f413fa9e..fa0e0e6e 100644 --- a/radicale/__init__.py +++ b/radicale/__init__.py @@ -409,7 +409,10 @@ class Application: else: # Get whole collection answer = collection.serialize() - etag = collection.etag + if answer is None: + return client.NOT_FOUND, {}, None + else: + etag = collection.etag if answer: headers = { diff --git a/radicale/storage.py b/radicale/storage.py index 5e142534..37bf565e 100644 --- a/radicale/storage.py +++ b/radicale/storage.py @@ -543,6 +543,8 @@ class Collection(BaseCollection): return time.strftime("%a, %d %b %Y %H:%M:%S GMT", time.gmtime(last)) def serialize(self): + if not os.path.exists(self._filesystem_path): + return None items = [] for href in os.listdir(self._filesystem_path): path = os.path.join(self._filesystem_path, href)