From: Olivier Lamy Date: Wed, 2 Nov 2011 22:29:46 +0000 (+0000) Subject: do not index directory in case of group: prevent NPE X-Git-Tag: archiva-1.4-M2~189 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=546014d1946edb769bd6dceb7db53a6cd23a974e;p=archiva.git 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 --- diff --git a/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResourceFactory.java b/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResourceFactory.java index 057c7a872..b99b2cf4d 100644 --- a/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResourceFactory.java +++ b/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResourceFactory.java @@ -951,12 +951,15 @@ public class ArchivaDavResourceFactory { // in case of group displaying index directory doesn't have sense !! String repoIndexDirectory = managedRepository.getRepository().getIndexDirectory(); - if ( !new File( repoIndexDirectory ).isAbsolute() ) + if ( StringUtils.isNotEmpty( repoIndexDirectory ) ) { - repoIndexDirectory = new File( managedRepository.getRepository().getLocation(), - StringUtils.isEmpty( repoIndexDirectory ) - ? ".indexer" - : repoIndexDirectory ).getAbsolutePath(); + if ( !new File( repoIndexDirectory ).isAbsolute() ) + { + repoIndexDirectory = new File( managedRepository.getRepository().getLocation(), + StringUtils.isEmpty( repoIndexDirectory ) + ? ".indexer" + : repoIndexDirectory ).getAbsolutePath(); + } } if ( StringUtils.isEmpty( repoIndexDirectory ) ) {