summaryrefslogtreecommitdiffstats
path: root/archiva-modules
diff options
context:
space:
mode:
authorOlivier Lamy <olamy@apache.org>2013-12-16 22:35:10 +0000
committerOlivier Lamy <olamy@apache.org>2013-12-16 22:35:10 +0000
commit66ed6cb4b0103fe9e9935f0ccd84fd833b2c09ec (patch)
tree7ff752e2ccd3f5a84cbd70adc11a63be9651a989 /archiva-modules
parent52caa0198b6f95142300daa37122d6e5dbbf9399 (diff)
downloadarchiva-66ed6cb4b0103fe9e9935f0ccd84fd833b2c09ec.tar.gz
archiva-66ed6cb4b0103fe9e9935f0ccd84fd833b2c09ec.zip
prevent possible NPE
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1551386 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules')
-rw-r--r--archiva-modules/archiva-base/archiva-filelock/src/main/java/org/apache/archiva/common/filelock/DefaultFileLockManager.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/archiva-modules/archiva-base/archiva-filelock/src/main/java/org/apache/archiva/common/filelock/DefaultFileLockManager.java b/archiva-modules/archiva-base/archiva-filelock/src/main/java/org/apache/archiva/common/filelock/DefaultFileLockManager.java
index ba3ab2fa1..09008e2a7 100644
--- a/archiva-modules/archiva-base/archiva-filelock/src/main/java/org/apache/archiva/common/filelock/DefaultFileLockManager.java
+++ b/archiva-modules/archiva-base/archiva-filelock/src/main/java/org/apache/archiva/common/filelock/DefaultFileLockManager.java
@@ -102,7 +102,10 @@ public class DefaultFileLockManager
{
// can happen if an other thread has deleted the file
// close RandomAccessFile!!!
- closeQuietly( lock.getRandomAccessFile() );
+ if ( lock != null )
+ {
+ closeQuietly( lock.getRandomAccessFile() );
+ }
log.debug( "read Lock skip: {} try to create file", e.getMessage() );
createNewFileQuietly( file );
}
@@ -178,8 +181,10 @@ public class DefaultFileLockManager
{
// can happen if an other thread has deleted the file
// close RandomAccessFile!!!
- closeQuietly( lock.getRandomAccessFile() );
-
+ if ( lock != null )
+ {
+ closeQuietly( lock.getRandomAccessFile() );
+ }
log.debug( "write Lock skip: {} try to create file", e.getMessage() );
createNewFileQuietly( file );
}