Skip to content

Commit

Permalink
'#2203: Check if the exported file exists to avoid broken links.
Browse files Browse the repository at this point in the history
  • Loading branch information
wladimirleite committed May 14, 2024
1 parent 9ba47e0 commit 1d912b2
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,13 @@ protected void process(IItem evidence) throws Exception {
ReportEntry reg = new ReportEntry();
reg.name = evidence.getName();
reg.export = evidence.getIdInDataSource();
if (reg.export != null && output != null && output.getParentFile() != null) {
// Check if the exported file exists to avoid broken links (see issue #2203)
File expFile = new File(output.getParentFile(), reg.export);
if (!expFile.exists()) {
reg.export = null;
}
}
reg.isImage = ImageThumbTask.isImageType(evidence.getMediaType());
reg.isVideo = VideoThumbTask.isVideoType(evidence.getMediaType());
reg.length = evidence.getLength();
Expand Down

0 comments on commit 1d912b2

Please sign in to comment.