]> source.dussan.org Git - archiva.git/commitdiff
do not index directory in case of group: prevent NPE
authorOlivier Lamy <olamy@apache.org>
Wed, 2 Nov 2011 22:29:46 +0000 (22:29 +0000)
committerOlivier Lamy <olamy@apache.org>
Wed, 2 Nov 2011 22:29:46 +0000 (22:29 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1196835 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResourceFactory.java

index 057c7a872d15c11b7157ac8248a9fc0f340d67c9..b99b2cf4d7cdb5ceeab072e7d70b22db28f22d23 100644 (file)
@@ -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 ) )
                     {