mirror of https://github.com/apache/archiva.git
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:
parent
db42cac593
commit
7de944c47c
|
@ -157,8 +157,12 @@ public class DefaultConfigurationStore
|
||||||
getLogger().info( "Writing configuration to " + file );
|
getLogger().info( "Writing configuration to " + file );
|
||||||
FileWriter fileWriter = null;
|
FileWriter fileWriter = null;
|
||||||
try
|
try
|
||||||
|
{
|
||||||
|
//does file directory exist ?
|
||||||
|
if ( file.getParentFile() != null && !file.getParentFile().exists() )
|
||||||
{
|
{
|
||||||
file.getParentFile().mkdirs();
|
file.getParentFile().mkdirs();
|
||||||
|
}
|
||||||
|
|
||||||
fileWriter = new FileWriter( file );
|
fileWriter = new FileWriter( file );
|
||||||
writer.write( fileWriter, configuration );
|
writer.write( fileWriter, configuration );
|
||||||
|
|
Loading…
Reference in New Issue