diff options
author | Olivier Lamy <olamy@apache.org> | 2011-10-07 10:39:59 +0000 |
---|---|---|
committer | Olivier Lamy <olamy@apache.org> | 2011-10-07 10:39:59 +0000 |
commit | c98687154cd8fd6e255bd818cfb6c658ef0ce43e (patch) | |
tree | 9f714bdad45392b1298f7f51058a37093846b815 | |
parent | 403c5e5535b65bb7559e880485e272353aebb304 (diff) | |
download | archiva-c98687154cd8fd6e255bd818cfb6c658ef0ce43e.tar.gz archiva-c98687154cd8fd6e255bd818cfb6c658ef0ce43e.zip |
fix NPE in ArtifactLocator during scanning
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1179990 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/search/NexusRepositorySearch.java | 7 |
1 files changed, 6 insertions, 1 deletions
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(); |