Added check against empty reference
authorThierry Florac <tflorac@ulthar.net>
Tue, 17 Jul 2018 23:20:51 +0200
changeset 55 198e62d68d1f
parent 54 3f9dda94c354
child 56 ce427eec067c
Added check against empty reference
src/pyams_sequence/reference.py
--- a/src/pyams_sequence/reference.py	Thu Jul 12 16:00:06 2018 +0200
+++ b/src/pyams_sequence/reference.py	Tue Jul 17 23:20:51 2018 +0200
@@ -128,6 +128,8 @@
 
 def get_reference_target(reference, state=None, request=None):
     """Get target of given reference OID"""
+    if not reference:
+        return None
     catalog = get_utility(ICatalog)
     params = Eq(catalog['oid'], reference)
     results = list(CatalogResultSet(CatalogQuery(catalog).query(params)))