From c98687154cd8fd6e255bd818cfb6c658ef0ce43e Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Fri, 7 Oct 2011 10:39:59 +0000 Subject: fix NPE in ArtifactLocator during scanning git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1179990 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/archiva/indexer/search/NexusRepositorySearch.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/search/NexusRepositorySearch.java b/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/search/NexusRepositorySearch.java index 09efd05d9..965aa49f4 100644 --- a/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/search/NexusRepositorySearch.java +++ b/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/search/NexusRepositorySearch.java @@ -34,6 +34,9 @@ import org.apache.lucene.search.BooleanQuery; import org.apache.maven.index.ArtifactInfo; import org.apache.maven.index.FlatSearchRequest; import org.apache.maven.index.FlatSearchResponse; +import org.apache.maven.index.GroupedSearchRequest; +import org.apache.maven.index.Grouping; +import org.apache.maven.index.IteratorSearchRequest; import org.apache.maven.index.MAVEN; import org.apache.maven.index.NexusIndexer; import org.apache.maven.index.OSGI; @@ -235,8 +238,10 @@ public class NexusRepositorySearch { FlatSearchRequest request = new FlatSearchRequest( q ); request.setContexts( getIndexingContexts( indexingContextIds ) ); + FlatSearchResponse response = indexer.searchFlat( request ); + if ( response == null || response.getTotalHits() == 0 ) { SearchResults results = new SearchResults(); @@ -590,7 +595,7 @@ public class NexusRepositorySearch return true; } - private SearchResults paginate( SearchResults results ) + protected SearchResults paginate( SearchResults results ) { SearchResultLimits limits = results.getLimits(); SearchResults paginated = new SearchResults(); -- cgit v1.2.3