Skip to content
Snippets Groups Projects
Commit 71c145fd authored by Richard Cordovano's avatar Richard Cordovano Committed by GitHub
Browse files

Merge pull request #2999 from APriestman/2819_preventEmptyCaseOrDatasource

Prevent empty case or datasource when tagging artifacts as bad
parents 47e69bd3 af55a3ef
Branches
Tags
No related merge requests found
...@@ -1095,6 +1095,20 @@ public void setArtifactInstanceKnownBad(EamArtifact eamArtifact) throws EamDbExc ...@@ -1095,6 +1095,20 @@ public void setArtifactInstanceKnownBad(EamArtifact eamArtifact) throws EamDbExc
preparedUpdate.executeUpdate(); preparedUpdate.executeUpdate();
} else { } else {
// In this case, the user is tagging something that isn't in the database,
// which means the case and/or datasource may also not be in the database.
// We could improve effiency by keeping a list of all datasources and cases
// in the database, but we don't expect the user to be tagging large numbers
// of items (that didn't have the CE ingest module run on them) at once.
if(null == getCaseDetails(eamInstance.getEamCase().getCaseUUID())){
newCase(eamInstance.getEamCase());
}
if (null == getDataSourceDetails(eamInstance.getEamDataSource().getDeviceID())) {
newDataSource(eamInstance.getEamDataSource());
}
eamArtifact.getInstances().get(0).setKnownStatus(TskData.FileKnown.BAD); eamArtifact.getInstances().get(0).setKnownStatus(TskData.FileKnown.BAD);
addArtifact(eamArtifact); addArtifact(eamArtifact);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment