# HG changeset patch # User Thierry Florac # Date 1289370864 -3600 # Node ID c262ddb4d656acaf36825762c6e453235a29a9cb # Parent a4367f6969e859e61c15adcfbfb3e16cce86325e Check "None" values in getObject and getObjectId functions diff -r a4367f6969e8 -r c262ddb4d656 ztfy/utils/catalog/__init__.py --- a/ztfy/utils/catalog/__init__.py Wed Sep 08 07:47:20 2010 +0200 +++ b/ztfy/utils/catalog/__init__.py Wed Nov 10 07:34:24 2010 +0100 @@ -53,6 +53,8 @@ def getObjectId(object, intids_name='', request=None, context=None): """Look for an object Id as recorded by given IIntIds utility""" + if object is None: + return None if request is None: request = request_utils.getRequest() intids = getIntIdUtility(intids_name, request, context) @@ -63,6 +65,8 @@ def getObject(id, intids_name='', request=None, context=None): """Look for an object recorded by given IIntIds utility and id""" + if id is None: + return None if request is None: request = request_utils.getRequest() intids = getIntIdUtility(intids_name, request, context)