]> source.dussan.org Git - archiva.git/commitdiff
Fix error 500 with NPE when user click the dependency link of the current artifact...
authorEmmanuel Venisse <evenisse@apache.org>
Tue, 27 Feb 2007 14:04:47 +0000 (14:04 +0000)
committerEmmanuel Venisse <evenisse@apache.org>
Tue, 27 Feb 2007 14:04:47 +0000 (14:04 +0000)
git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@512258 13f79535-47bb-0310-9956-ffa450edef68

archiva-webapp/src/main/java/org/apache/maven/archiva/web/tags/DownloadArtifact.java

index 79c4b95b64e34d7be8d290ddece3265a11c2d6a1..c84d33ab030331d3abdfcaeec6a5fc4c9c9b458f 100644 (file)
@@ -93,17 +93,21 @@ public class DownloadArtifact
         try
         {
             ManagedArtifact managedArtifact = managedRepositories.findArtifact( groupId, artifactId, version );
-            RepositoryConfiguration repoConfig = managedRepositories.getRepositoryConfiguration( managedArtifact
-                .getRepositoryId() );
-            String prefix = req.getContextPath() + "/repository/" + repoConfig.getUrlName();
 
-            if ( mini )
+            if ( managedArtifact != null )
             {
-                appendMini( sb, prefix, managedArtifact );
-            }
-            else
-            {
-                appendNormal( sb, prefix, managedArtifact );
+                RepositoryConfiguration repoConfig = managedRepositories.getRepositoryConfiguration( managedArtifact
+                    .getRepositoryId() );
+                String prefix = req.getContextPath() + "/repository/" + repoConfig.getUrlName();
+
+                if ( mini )
+                {
+                    appendMini( sb, prefix, managedArtifact );
+                }
+                else
+                {
+                    appendNormal( sb, prefix, managedArtifact );
+                }
             }
         }
         catch ( ProjectBuildingException e )