mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-14 17:06:16 +00:00
Merge pull request #2377 from wishdasher/develop
ReportHTML NPE catch and log with detailed error message
This commit is contained in:
commit
3e371d3c68
@ -1126,13 +1126,17 @@ class ReportHTML implements TableReportModule {
|
||||
if (thumbFile.exists() == false) {
|
||||
return null;
|
||||
}
|
||||
File to = new File(thumbsPath);
|
||||
FileObject from = FileUtil.toFileObject(thumbFile);
|
||||
FileObject dest = FileUtil.toFileObject(to);
|
||||
try {
|
||||
File to = new File(thumbsPath);
|
||||
FileObject from = FileUtil.toFileObject(thumbFile);
|
||||
FileObject dest = FileUtil.toFileObject(to);
|
||||
FileUtil.copyFile(from, dest, thumbFile.getName(), "");
|
||||
} catch (IOException ex) {
|
||||
logger.log(Level.SEVERE, "Failed to write thumb file to report directory.", ex); //NON-NLS
|
||||
} catch (NullPointerException ex) {
|
||||
logger.log(Level.SEVERE, "NPE generated from FileUtil.copyFile, probably because FileUtil.toFileObject returned null. \n" +
|
||||
"The File argument for toFileObject was " + thumbFile + " with toString: " + thumbFile.toString() + "\n" +
|
||||
"The FileObject returned by toFileObject, passed into FileUtil.copyFile, was " + from, ex);
|
||||
}
|
||||
|
||||
return THUMBS_REL_PATH + thumbFile.getName();
|
||||
|
Loading…
x
Reference in New Issue
Block a user