mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-15 09:17:42 +00:00
return nothing if json cannot be parsed
This commit is contained in:
parent
da7fe3b905
commit
7640c0f549
@ -156,7 +156,6 @@ class AccountSummary {
|
|||||||
countFromMessageAttachments(attachmentsAttr, artifact);
|
countFromMessageAttachments(attachmentsAttr, artifact);
|
||||||
} catch (BlackboardJsonAttrUtil.InvalidJsonException ex) {
|
} catch (BlackboardJsonAttrUtil.InvalidJsonException ex) {
|
||||||
logger.log(Level.WARNING, String.format("Unable to parse json for MessageAttachments object in artifact: %s", artifact.getName()), ex);
|
logger.log(Level.WARNING, String.format("Unable to parse json for MessageAttachments object in artifact: %s", artifact.getName()), ex);
|
||||||
countFromArtifactChildren(artifact);
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
countFromArtifactChildren(artifact);
|
countFromArtifactChildren(artifact);
|
||||||
|
@ -134,7 +134,6 @@ final class AttachmentThumbnailsChildren extends Children.Keys<AbstractFile> {
|
|||||||
addMessageAttachmentThumbnails(bba, attachmentsAttr, thumbnails);
|
addMessageAttachmentThumbnails(bba, attachmentsAttr, thumbnails);
|
||||||
} catch (BlackboardJsonAttrUtil.InvalidJsonException ex) {
|
} catch (BlackboardJsonAttrUtil.InvalidJsonException ex) {
|
||||||
LOGGER.log(Level.WARNING, String.format("Unable to parse json for MessageAttachments object in artifact: %s", bba.getName()), ex);
|
LOGGER.log(Level.WARNING, String.format("Unable to parse json for MessageAttachments object in artifact: %s", bba.getName()), ex);
|
||||||
addChildrenThumbnails(bba, thumbnails);
|
|
||||||
}
|
}
|
||||||
} else { // backward compatibility - email message attachments are derived files, children of the message.
|
} else { // backward compatibility - email message attachments are derived files, children of the message.
|
||||||
addChildrenThumbnails(bba, thumbnails);
|
addChildrenThumbnails(bba, thumbnails);
|
||||||
|
@ -159,10 +159,12 @@ class MessageNode extends BlackboardArtifactNode {
|
|||||||
return msgAttachments.getAttachmentsCount();
|
return msgAttachments.getAttachmentsCount();
|
||||||
} catch (BlackboardJsonAttrUtil.InvalidJsonException ex) {
|
} catch (BlackboardJsonAttrUtil.InvalidJsonException ex) {
|
||||||
logger.log(Level.WARNING, String.format("Unable to parse json for MessageAttachments object in artifact: %s", artifact.getName()), ex);
|
logger.log(Level.WARNING, String.format("Unable to parse json for MessageAttachments object in artifact: %s", artifact.getName()), ex);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
// legacy attachments may be children of message artifact.
|
// legacy attachments may be children of message artifact.
|
||||||
return artifact.getChildrenCount();
|
return artifact.getChildrenCount();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -692,7 +692,7 @@ public class MessageContentViewer extends javax.swing.JPanel implements DataCont
|
|||||||
attachments = getAttachmentsFromMessageAttachments(attachmentsAttr);
|
attachments = getAttachmentsFromMessageAttachments(attachmentsAttr);
|
||||||
} catch (BlackboardJsonAttrUtil.InvalidJsonException ex) {
|
} catch (BlackboardJsonAttrUtil.InvalidJsonException ex) {
|
||||||
LOGGER.log(Level.WARNING, String.format("Unable to parse json for MessageAttachments object in artifact: %s", artifact.getName()), ex);
|
LOGGER.log(Level.WARNING, String.format("Unable to parse json for MessageAttachments object in artifact: %s", artifact.getName()), ex);
|
||||||
attachments = getAttachmentsFromChildren(artifact);
|
attachments = new HashSet<>();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
attachments = getAttachmentsFromChildren(artifact);
|
attachments = getAttachmentsFromChildren(artifact);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user