Merged HEAD-BUG-FIX (5.0/Cloud) to HEAD (5.0/Cloud)

83971: ALF-21100 - defensive code improvement around handing of invalid Search operator option.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@84607 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2014-09-18 17:19:22 +00:00
parent 17b9a6daf5
commit f422aaf88e

View File

@@ -670,10 +670,17 @@ public class Search extends BaseScopableProcessorExtension implements Initializi
{ {
sp.setDefaultFieldName(defaultField); sp.setDefaultFieldName(defaultField);
} }
if (defaultOperator != null) if (defaultOperator != null && defaultOperator.length() != 0)
{
try
{ {
sp.setDefaultOperator(Operator.valueOf(defaultOperator.toUpperCase())); sp.setDefaultOperator(Operator.valueOf(defaultOperator.toUpperCase()));
} }
catch (IllegalArgumentException e)
{
// ignore invalid Operator and the default value will be used
}
}
if (namespace != null) if (namespace != null)
{ {
sp.setNamespace(namespace); sp.setNamespace(namespace);