Fixes NPE causing page to fail on facet being absent
authorNiels Erik G. Nielsen <nielserik@indexdata.com>
Sun, 21 Apr 2013 13:21:28 +0000 (09:21 -0400)
committerNiels Erik G. Nielsen <nielserik@indexdata.com>
Sun, 21 Apr 2013 13:21:28 +0000 (09:21 -0400)
src/main/java/com/indexdata/mkjsf/pazpar2/data/TermListsResponse.java

index 27e3e1e..8b59291 100644 (file)
@@ -22,8 +22,12 @@ public class TermListsResponse extends Pazpar2ResponseData {
   public void addTermList(TermListResponse termList) {    \r
     this.termLists.put(termList.getName(),termList);\r
   }\r
-  public TermListResponse getTermList(String name) {    \r
-    return termLists.get(name);\r
+  public TermListResponse getTermList(String name) {\r
+    if (termLists.get(name)==null) {\r
+      return new TermListResponse();\r
+    } else {\r
+      return termLists.get(name);\r
+    }\r
   }\r
   \r
   \r