Fix crash when fetching nonexistent href

This commit is contained in:
Markus Unterwaditzer 2016-04-13 22:56:57 +02:00
parent f169f2f19b
commit 472d016d1e

View File

@ -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