From: Olivier Lamy Date: Wed, 15 Oct 2014 00:45:44 +0000 (+1100) Subject: avoid returning empty data X-Git-Tag: archiva-2.2.0~71 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=df99049a93df30a12eef5469706423152f23bb42;p=archiva.git avoid returning empty data --- diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultBrowseService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultBrowseService.java index dfbb58cc6..c7af0fece 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultBrowseService.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultBrowseService.java @@ -282,9 +282,16 @@ public class DefaultBrowseService { try { - versionMetadata = + ProjectVersionMetadata versionMetadataTmp = metadataResolver.resolveProjectVersion( repositorySession, repoId, groupId, artifactId, version ); + + if ( versionMetadata == null && versionMetadataTmp != null ) + { + versionMetadata = versionMetadataTmp; + } + + } catch ( MetadataResolutionException e ) { @@ -836,8 +843,7 @@ public class DefaultBrowseService ArchivaArtifact archivaArtifact = new ArchivaArtifact( groupId, artifactId, version, StringUtils.isEmpty( classifier ) ? "" - : classifier, "jar", repoId - ); + : classifier, "jar", repoId ); File file = managedRepositoryContent.toFile( archivaArtifact ); if ( file != null && file.exists() ) @@ -999,8 +1005,7 @@ public class DefaultBrowseService artifactContentEntryMap.put( entryRootPath, new ArtifactContentEntry( entryRootPath, !currentEntry.isDirectory(), - depth, repoId ) - ); + depth, repoId ) ); } else {