diff options
author | Emmanuel Venisse <evenisse@apache.org> | 2007-01-19 13:43:50 +0000 |
---|---|---|
committer | Emmanuel Venisse <evenisse@apache.org> | 2007-01-19 13:43:50 +0000 |
commit | 7de944c47c3603f0a1f7731cb0b6b4d64c2d30b1 (patch) | |
tree | 37e1c5975f557d4b27c868fa4a40dc267a24bc8f /archiva-configuration | |
parent | db42cac59301d92dfb9d9401d5b9a0267bb87e6f (diff) | |
download | archiva-7de944c47c3603f0a1f7731cb0b6b4d64c2d30b1.tar.gz archiva-7de944c47c3603f0a1f7731cb0b6b4d64c2d30b1.zip |
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
Diffstat (limited to 'archiva-configuration')
-rw-r--r-- | archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/DefaultConfigurationStore.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/DefaultConfigurationStore.java b/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/DefaultConfigurationStore.java index 3f8dd70f8..911f7eb87 100644 --- a/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/DefaultConfigurationStore.java +++ b/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/DefaultConfigurationStore.java @@ -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 ); |