Better check for missing request in getIntIdUtility() function ZTK-1.1
authorThierry Florac <tflorac@ulthar.net>
Thu, 13 Sep 2012 10:56:25 +0200
branchZTK-1.1
changeset 168 c02d355d3ffd
parent 167 f0336de241c3
child 169 b4b587dd45ca
Better check for missing request in getIntIdUtility() function
src/ztfy/utils/catalog/__init__.py
--- a/src/ztfy/utils/catalog/__init__.py	Tue Sep 11 16:26:38 2012 +0200
+++ b/src/ztfy/utils/catalog/__init__.py	Thu Sep 13 10:56:25 2012 +0200
@@ -43,7 +43,9 @@
     """Look for a named IIntIds utility"""
     if request is None:
         request = request_utils.queryRequest()
-    intids = request_utils.getRequestData('IntIdsUtility::' + name, request)
+    intids = None
+    if request is not None:
+        intids = request_utils.getRequestData('IntIdsUtility::' + name, request)
     if intids is None:
         intids = queryUtility(IIntIds, name, context=context)
         if (request is not None) and (intids is not None):