Added check so that keywords not can be empty and cause an NPE.

This commit is contained in:
Tom Vahlman 2012-03-22 20:07:24 +01:00
parent acea2a7211
commit 8bb0d7181a

@ -122,13 +122,15 @@ public class SupervisorDaoJPAImp extends QueryableDaoJPAImp<Employee, Supervisor
}
public QuerySet keywords(Collection<Keyword> keywords) {
if (keywords != null) {
if (keywords != null && !keywords.isEmpty()) {
getQuery().combine(
new Query().join("_.keywords.keywords k").where("k in (:keywords)").parameter(
"keywords", keywords)).distinct();
}
return this;
}
public QuerySet keyword(Keyword keyword) {
if (keyword != null) {