Add check against empty thesaurus name
authorThierry Florac <tflorac@ulthar.net>
Mon, 22 May 2017 00:43:49 +0200
changeset 32 d3f76ee1af66
parent 31 827feec71488
child 33 940234ecb095
Add check against empty thesaurus name
src/pyams_thesaurus/thesaurus.py
--- a/src/pyams_thesaurus/thesaurus.py	Tue May 16 11:25:21 2017 +0200
+++ b/src/pyams_thesaurus/thesaurus.py	Mon May 22 00:43:49 2017 +0200
@@ -374,7 +374,7 @@
             thesaurus = get_parent(context, IThesaurus)
             if thesaurus is None:
                 context_manager = IThesaurusContextManager(context, None)
-                if context_manager is not None:
+                if (context_manager is not None) and context_manager.thesaurus_name:
                     thesaurus = query_utility(IThesaurus, name=context_manager.thesaurus_name)
             if thesaurus is not None:
                 extracts = IThesaurusExtracts(thesaurus)