From 1d63bedc9d3eada9785b0793086a6f2ae4a91bf4 Mon Sep 17 00:00:00 2001 From: Greg DiCristofaro Date: Tue, 13 Jul 2021 10:14:41 -0400 Subject: [PATCH] don't show view source file or result if no associated artifact --- .../directorytree/DataResultFilterNode.java | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/directorytree/DataResultFilterNode.java b/Core/src/org/sleuthkit/autopsy/directorytree/DataResultFilterNode.java index 65fb6f850b..51fffee37f 100644 --- a/Core/src/org/sleuthkit/autopsy/directorytree/DataResultFilterNode.java +++ b/Core/src/org/sleuthkit/autopsy/directorytree/DataResultFilterNode.java @@ -291,11 +291,18 @@ public class DataResultFilterNode extends FilterNode { NbBundle.getMessage(this.getClass(), "DataResultFilterNode.action.viewFileInDir.text"), ban)); } } else if (artifactTypeID == BlackboardArtifact.ARTIFACT_TYPE.TSK_INTERESTING_ARTIFACT_HIT.getTypeID()) { - //action to go to the source artifact - actionsList.add(new ViewSourceArtifactAction(DataResultFilterNode_viewSourceArtifact_text(), ba)); - // action to go to the source file of the artifact - actionsList.add(new ViewContextAction( - NbBundle.getMessage(this.getClass(), "DataResultFilterNode.action.viewSrcFileInDir.text"), ban)); + try { + if (ba.getAttribute(BlackboardAttribute.Type.TSK_ASSOCIATED_ARTIFACT) != null) { + //action to go to the source artifact + actionsList.add(new ViewSourceArtifactAction(DataResultFilterNode_viewSourceArtifact_text(), ba)); + + // action to go to the source file of the artifact + actionsList.add(new ViewContextAction( + NbBundle.getMessage(this.getClass(), "DataResultFilterNode.action.viewSrcFileInDir.text"), ban)); + } + } catch (TskCoreException ex) { + LOGGER.log(Level.WARNING, "Error looking up attributes for artifact with ID=" + ba.getId()); + } } else { // if the artifact links to another file, add an action to go to // that file