From: Emmanuel Venisse Date: Tue, 27 Feb 2007 14:04:47 +0000 (+0000) Subject: Fix error 500 with NPE when user click the dependency link of the current artifact... X-Git-Tag: archiva-0.9-alpha-1~81 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=5e125fc536d6dc7527d85c935449fb24ce650947;p=archiva.git Fix error 500 with NPE when user click the dependency link of the current artifact and this dependency isn't in the repo git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@512258 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/archiva-webapp/src/main/java/org/apache/maven/archiva/web/tags/DownloadArtifact.java b/archiva-webapp/src/main/java/org/apache/maven/archiva/web/tags/DownloadArtifact.java index 79c4b95b6..c84d33ab0 100644 --- a/archiva-webapp/src/main/java/org/apache/maven/archiva/web/tags/DownloadArtifact.java +++ b/archiva-webapp/src/main/java/org/apache/maven/archiva/web/tags/DownloadArtifact.java @@ -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 )