Merge pull request #3266 from wschaeferB/2999-adjustSingleUserCaseDbLocks

2999 ensure lock is always release in AddRawImageTask
This commit is contained in:
Richard Cordovano 2017-12-07 14:48:24 -05:00 committed by GitHub
commit 330bdd63d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -126,8 +126,6 @@ final class AddRawImageTask implements Runnable {
progressMonitor.setProgressText(Bundle.AddRawImageTask_progress_add_text() + imageFilePath);
List<String> imageFilePaths = new ArrayList<>();
SleuthkitCase caseDatabase = Case.getCurrentCase().getSleuthkitCase();
caseDatabase.acquireSingleUserCaseWriteLock();
File imageFile = Paths.get(imageFilePath).toFile();
if (!imageFile.exists()) {
String errorMessage = Bundle.AddRawImageTask_image_critical_error_adding() + imageFilePath + Bundle.AddRawImageTask_for_device()
@ -136,11 +134,10 @@ final class AddRawImageTask implements Runnable {
logger.log(Level.SEVERE, errorMessage);
criticalErrorOccurred = true;
return;
}
imageFilePaths.add(imageFilePath);
try {
}
imageFilePaths.add(imageFilePath);
try {
caseDatabase.acquireSingleUserCaseWriteLock();
/*
* Get Image that will be added to case
*/