Skip to content

Commit

Permalink
Fix nullpointer issue when collection refs are missing
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanpadams committed Aug 1, 2024
1 parent 37a6670 commit 30e627c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/main/java/gov/nasa/pds/dsview/registry/PDS4Search.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public SolrDocumentList getCollections() throws SolrServerException, IOException
//params.set("fq", "facet_object_type:\"1,product_collection\"");
params.set("fq", "facet_type:\"1,collection\"");

log.info("params = " + params.toString());
log.fine("params = " + params.toString());
QueryResponse response = solr.query(params,
org.apache.solr.client.solrj.SolrRequest.METHOD.GET);

Expand Down Expand Up @@ -114,12 +114,12 @@ public SolrDocumentList getBundles() throws SolrServerException, IOException {
params.set("fq", "facet_type:\"1,bundle\"");
//params.set("start", start);

log.info("params = " + params.toString());
log.fine("params = " + params.toString());
QueryResponse response = solr.query(params,
org.apache.solr.client.solrj.SolrRequest.METHOD.GET);

SolrDocumentList solrResults = response.getResults();
log.info("numFound = " + solrResults.getNumFound());
log.fine("numFound = " + solrResults.getNumFound());

Iterator<SolrDocument> itr = solrResults.iterator();
int idx = 0;
Expand Down Expand Up @@ -191,7 +191,7 @@ public SolrDocumentList getDocuments() throws SolrServerException, IOException {
params.set("wt", "xml");
params.set("fq", "facet_type:\"1,document\"");

log.info("params = " + params.toString());
log.fine("params = " + params.toString());
QueryResponse response = solr.query(params,
org.apache.solr.client.solrj.SolrRequest.METHOD.GET);

Expand Down Expand Up @@ -231,7 +231,7 @@ public SolrDocument getContext(String identifier) throws SolrServerException, IO
params.set("wt", "xml");
params.set("qt", "archive-filter");

log.info("params = " + params.toString());
log.fine("params = " + params.toString());
QueryResponse response =
solr.query(params, org.apache.solr.client.solrj.SolrRequest.METHOD.GET);

Expand Down
4 changes: 3 additions & 1 deletion src/main/webapp/pds/viewBundle.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,9 @@
if (pds4Search.getValues(collDoc, "collection_type")!=null) {
collType = pds4Search.getValues(collDoc, "collection_type").get(0);
}
}
} else {
continue; // data not yet registered, continue
}
String lowCollName = collType.toLowerCase();
if (lowCollName.contains("browse")) {
Expand Down

0 comments on commit 30e627c

Please sign in to comment.