From bb40c6b7cb9780e693f01a2aa6bb97942539ef5f Mon Sep 17 00:00:00 2001 From: "Niels Erik G. Nielsen" Date: Sun, 21 Apr 2013 09:21:28 -0400 Subject: [PATCH] Fixes NPE causing page to fail on facet being absent --- .../com/indexdata/mkjsf/pazpar2/data/TermListsResponse.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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); + } } -- 1.7.10.4