mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-19 11:07:43 +00:00
Merge pull request #3266 from wschaeferB/2999-adjustSingleUserCaseDbLocks
2999 ensure lock is always release in AddRawImageTask
This commit is contained in:
commit
330bdd63d7
@ -126,8 +126,6 @@ final class AddRawImageTask implements Runnable {
|
|||||||
progressMonitor.setProgressText(Bundle.AddRawImageTask_progress_add_text() + imageFilePath);
|
progressMonitor.setProgressText(Bundle.AddRawImageTask_progress_add_text() + imageFilePath);
|
||||||
List<String> imageFilePaths = new ArrayList<>();
|
List<String> imageFilePaths = new ArrayList<>();
|
||||||
SleuthkitCase caseDatabase = Case.getCurrentCase().getSleuthkitCase();
|
SleuthkitCase caseDatabase = Case.getCurrentCase().getSleuthkitCase();
|
||||||
caseDatabase.acquireSingleUserCaseWriteLock();
|
|
||||||
|
|
||||||
File imageFile = Paths.get(imageFilePath).toFile();
|
File imageFile = Paths.get(imageFilePath).toFile();
|
||||||
if (!imageFile.exists()) {
|
if (!imageFile.exists()) {
|
||||||
String errorMessage = Bundle.AddRawImageTask_image_critical_error_adding() + imageFilePath + Bundle.AddRawImageTask_for_device()
|
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);
|
logger.log(Level.SEVERE, errorMessage);
|
||||||
criticalErrorOccurred = true;
|
criticalErrorOccurred = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
imageFilePaths.add(imageFilePath);
|
||||||
imageFilePaths.add(imageFilePath);
|
try {
|
||||||
|
caseDatabase.acquireSingleUserCaseWriteLock();
|
||||||
try {
|
|
||||||
/*
|
/*
|
||||||
* Get Image that will be added to case
|
* Get Image that will be added to case
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user