From 37b51d0c626ed30e58ec7791315f80f71152c6fb Mon Sep 17 00:00:00 2001 From: Greg DiCristofaro Date: Wed, 13 Jan 2021 14:15:18 -0500 Subject: [PATCH] fix for validating artifact type --- .../modules/leappanalyzers/LeappFileProcessor.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/modules/leappanalyzers/LeappFileProcessor.java b/Core/src/org/sleuthkit/autopsy/modules/leappanalyzers/LeappFileProcessor.java index e48943c15e..cf465c33da 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/leappanalyzers/LeappFileProcessor.java +++ b/Core/src/org/sleuthkit/autopsy/modules/leappanalyzers/LeappFileProcessor.java @@ -532,11 +532,13 @@ public final class LeappFileProcessor { String comment = nnm.getNamedItem("comment").getNodeValue(); String parentName = artifactNlist.item(k).getParentNode().getAttributes().getNamedItem("filename").getNodeValue(); - BlackboardArtifact.ARTIFACT_TYPE foundArtifactType = Stream.of(BlackboardArtifact.ARTIFACT_TYPE.values()) - .filter((art_type) -> art_type.name().equalsIgnoreCase(artifactName)) - .findFirst() - .orElse(null); - + BlackboardArtifact.ARTIFACT_TYPE foundArtifactType = null; + try { + Case.getCurrentCase().getSleuthkitCase().getArtifactType(artifactName); + } catch (TskCoreException ex) { + logger.log(Level.SEVERE, String.format("There was an issue that arose while trying to fetch artifact type for %s.", artifactName), ex); + } + if (foundArtifactType == null) { logger.log(Level.SEVERE, String.format("No known artifact mapping found for [artifact: %s, %s]", artifactName, getXmlFileIdentifier(parentName)));