From 30e627cab32cd95d749287a00bb6f094a3f37989 Mon Sep 17 00:00:00 2001 From: Jordan Padams Date: Thu, 1 Aug 2024 11:42:49 -0700 Subject: [PATCH] Fix nullpointer issue when collection refs are missing --- .../java/gov/nasa/pds/dsview/registry/PDS4Search.java | 10 +++++----- src/main/webapp/pds/viewBundle.jsp | 4 +++- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/main/java/gov/nasa/pds/dsview/registry/PDS4Search.java b/src/main/java/gov/nasa/pds/dsview/registry/PDS4Search.java index 2ae16864d..9ea4d8c99 100644 --- a/src/main/java/gov/nasa/pds/dsview/registry/PDS4Search.java +++ b/src/main/java/gov/nasa/pds/dsview/registry/PDS4Search.java @@ -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); @@ -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 itr = solrResults.iterator(); int idx = 0; @@ -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); @@ -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); diff --git a/src/main/webapp/pds/viewBundle.jsp b/src/main/webapp/pds/viewBundle.jsp index 9376909de..f063e2c02 100644 --- a/src/main/webapp/pds/viewBundle.jsp +++ b/src/main/webapp/pds/viewBundle.jsp @@ -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")) {