From 546014d1946edb769bd6dceb7db53a6cd23a974e Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Wed, 2 Nov 2011 22:29:46 +0000 Subject: [PATCH] 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 --- .../archiva/webdav/ArchivaDavResourceFactory.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) 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 ) ) { -- 2.39.5