]> source.dussan.org Git - archiva.git/commitdiff
avoid returning empty data
authorOlivier Lamy <olamy@apache.org>
Wed, 15 Oct 2014 00:45:44 +0000 (11:45 +1100)
committerOlivier Lamy <olamy@apache.org>
Wed, 15 Oct 2014 00:45:44 +0000 (11:45 +1100)
archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultBrowseService.java

index dfbb58cc6031e1374a1130d1723482ed947eb672..c7af0fece4385b4a4f6d788dba80ac8f1c1369d5 100644 (file)
@@ -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
                 {