Fix NPE when file is a root file

git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@497811 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Emmanuel Venisse 2007-01-19 13:43:50 +00:00
parent db42cac593
commit 7de944c47c
1 changed files with 5 additions and 1 deletions

View File

@ -158,7 +158,11 @@ public class DefaultConfigurationStore
FileWriter fileWriter = null;
try
{
file.getParentFile().mkdirs();
//does file directory exist ?
if ( file.getParentFile() != null && !file.getParentFile().exists() )
{
file.getParentFile().mkdirs();
}
fileWriter = new FileWriter( file );
writer.write( fileWriter, configuration );