do not index directory in case of group: prevent NPE

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1196835 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Olivier Lamy 2011-11-02 22:29:46 +00:00
parent c814b9b981
commit 546014d194
1 changed files with 8 additions and 5 deletions

View File

@ -951,6 +951,8 @@ public class ArchivaDavResourceFactory
{
// in case of group displaying index directory doesn't have sense !!
String repoIndexDirectory = managedRepository.getRepository().getIndexDirectory();
if ( StringUtils.isNotEmpty( repoIndexDirectory ) )
{
if ( !new File( repoIndexDirectory ).isAbsolute() )
{
repoIndexDirectory = new File( managedRepository.getRepository().getLocation(),
@ -958,6 +960,7 @@ public class ArchivaDavResourceFactory
? ".indexer"
: repoIndexDirectory ).getAbsolutePath();
}
}
if ( StringUtils.isEmpty( repoIndexDirectory ) )
{
repoIndexDirectory =