From 472d016d1e1c360efb508d043957ddef67387b6f Mon Sep 17 00:00:00 2001 From: Markus Unterwaditzer Date: Wed, 13 Apr 2016 22:56:57 +0200 Subject: [PATCH] Fix crash when fetching nonexistent href --- radicale/xmlutils.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/radicale/xmlutils.py b/radicale/xmlutils.py index 2e09993..beae90c 100644 --- a/radicale/xmlutils.py +++ b/radicale/xmlutils.py @@ -522,13 +522,14 @@ def report(path, xml_request, collection): if name: # Reference is an item path = "/".join(hreference.split("/")[:-1]) + "/" - try: - items = [collection.get(name)] - except KeyError: + item = collection.get(name) + if item is None: multistatus.append( _item_response(hreference, found_item=False)) continue + items = [item] + else: # Reference is a collection path = hreference