From: Niels Erik G. Nielsen Date: Sun, 21 Apr 2013 13:21:28 +0000 (-0400) Subject: Fixes NPE causing page to fail on facet being absent X-Git-Tag: v0.0.7~147 X-Git-Url: http://lists.indexdata.com/cgi-bin?a=commitdiff_plain;h=bb40c6b7cb9780e693f01a2aa6bb97942539ef5f;p=mkjsf-moved-to-github.git Fixes NPE causing page to fail on facet being absent --- diff --git a/src/main/java/com/indexdata/mkjsf/pazpar2/data/TermListsResponse.java b/src/main/java/com/indexdata/mkjsf/pazpar2/data/TermListsResponse.java index 27e3e1e..8b59291 100644 --- a/src/main/java/com/indexdata/mkjsf/pazpar2/data/TermListsResponse.java +++ b/src/main/java/com/indexdata/mkjsf/pazpar2/data/TermListsResponse.java @@ -22,8 +22,12 @@ public class TermListsResponse extends Pazpar2ResponseData { public void addTermList(TermListResponse termList) { this.termLists.put(termList.getName(),termList); } - public TermListResponse getTermList(String name) { - return termLists.get(name); + public TermListResponse getTermList(String name) { + if (termLists.get(name)==null) { + return new TermListResponse(); + } else { + return termLists.get(name); + } }