Skip to content
Snippets Groups Projects
Commit 2d7175df authored by millmanorama's avatar millmanorama
Browse files

don't process artifacts with no time attribute

parent 38796548
No related branches found
No related tags found
No related merge requests found
...@@ -18,6 +18,8 @@ ...@@ -18,6 +18,8 @@
*/ */
package org.sleuthkit.datamodel.timeline; package org.sleuthkit.datamodel.timeline;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.sleuthkit.datamodel.BlackboardArtifact; import org.sleuthkit.datamodel.BlackboardArtifact;
import org.sleuthkit.datamodel.BlackboardAttribute; import org.sleuthkit.datamodel.BlackboardAttribute;
import org.sleuthkit.datamodel.TskCoreException; import org.sleuthkit.datamodel.TskCoreException;
...@@ -29,10 +31,19 @@ ...@@ -29,10 +31,19 @@
*/ */
class SingleDescriptionArtifactEventType extends StandardArtifactEventType { class SingleDescriptionArtifactEventType extends StandardArtifactEventType {
private static final Logger logger = Logger.getLogger(SingleDescriptionArtifactEventType.class.getName());
@Override @Override
public EventDescriptionWithTime buildEventPayload(BlackboardArtifact artifact) throws TskCoreException { public EventDescriptionWithTime buildEventPayload(BlackboardArtifact artifact) throws TskCoreException {
String description = extractFullDescription(artifact); String description = extractFullDescription(artifact);
long time = artifact.getAttribute(getDateTimeAttributeType()).getValueLong(); BlackboardAttribute timeAttribute = artifact.getAttribute(getDateTimeAttributeType());
if (timeAttribute == null) {
logger.log(Level.WARNING, "Artifact {0} has no date/time attribute, skipping it.", artifact.toString()); // NON-NLS
return null;
}
long time = timeAttribute.getValueLong();
return new EventDescriptionWithTime(time, null, null, description); return new EventDescriptionWithTime(time, null, null, description);
} }
......
...@@ -121,7 +121,7 @@ public EventDescriptionWithTime buildEventPayload(BlackboardArtifact artifact) t ...@@ -121,7 +121,7 @@ public EventDescriptionWithTime buildEventPayload(BlackboardArtifact artifact) t
} }
BlackboardAttribute timeAttribute = artifact.getAttribute(getDateTimeAttributeType()); BlackboardAttribute timeAttribute = artifact.getAttribute(getDateTimeAttributeType());
if (timeAttribute == null) { if (timeAttribute == null) {
logger.log(Level.WARNING, "Artifact {0} has no date/time attribute, skipping it.", artifact.getArtifactID()); // NON-NLS logger.log(Level.WARNING, "Artifact {0} has no date/time attribute, skipping it.", artifact.toString()); // NON-NLS
return null; return null;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment