From ad8d4e7a9deb3d375a4479313ec4741eff9d9c09 Mon Sep 17 00:00:00 2001 From: Kelly Kelly Date: Thu, 9 Sep 2021 15:50:31 -0400 Subject: [PATCH] Fixed exception create cc bin nodes --- .../autopsy/datamodel/accounts/Accounts.java | 22 +++++-------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/accounts/Accounts.java b/Core/src/org/sleuthkit/autopsy/datamodel/accounts/Accounts.java index bf7ee1caba..9c84b85bfe 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/accounts/Accounts.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/accounts/Accounts.java @@ -1481,7 +1481,7 @@ final public class Accounts implements AutopsyVisitableItem { } } - final private class CreditCardNumberFactory extends ObservingChildren { + final private class CreditCardNumberFactory extends ObservingChildren { private final BinResult bin; @@ -1502,10 +1502,10 @@ final public class Accounts implements AutopsyVisitableItem { } @Override - protected boolean createKeys(List list) { + protected boolean createKeys(List list) { String query - = "SELECT blackboard_artifacts.artifact_id " //NON-NLS + = "SELECT blackboard_artifacts.artifact_obj_id " //NON-NLS + " FROM blackboard_artifacts " //NON-NLS + " JOIN blackboard_attributes ON blackboard_artifacts.artifact_id = blackboard_attributes.artifact_id " //NON-NLS + " WHERE blackboard_artifacts.artifact_type_id = " + BlackboardArtifact.Type.TSK_ACCOUNT.getTypeID() //NON-NLS @@ -1517,7 +1517,7 @@ final public class Accounts implements AutopsyVisitableItem { try (SleuthkitCase.CaseDbQuery results = skCase.executeQuery(query); ResultSet rs = results.getResultSet();) { while (rs.next()) { - list.add(rs.getLong("artifact_id")); //NON-NLS + list.add(skCase.getBlackboard().getDataArtifactById(rs.getLong("artifact_obj_id"))); //NON-NLS } } catch (TskCoreException | SQLException ex) { LOGGER.log(Level.SEVERE, "Error querying for account artifacts.", ex); //NON-NLS @@ -1527,18 +1527,8 @@ final public class Accounts implements AutopsyVisitableItem { } @Override - protected Node[] createNodesForKey(Long artifactID) { - if (skCase == null) { - return new Node[0]; - } - - try { - DataArtifact art = skCase.getBlackboard().getDataArtifactById(artifactID); - return new Node[]{new AccountArtifactNode(art)}; - } catch (TskCoreException ex) { - LOGGER.log(Level.SEVERE, "Error creating BlackboardArtifactNode for artifact with ID " + artifactID, ex); //NON-NLS - return new Node[0]; - } + protected Node[] createNodesForKey(DataArtifact artifact) { + return new Node[]{new AccountArtifactNode(artifact)}; } }