Skip to content
Snippets Groups Projects
Unverified Commit 0dd9b0cd authored by Richard Cordovano's avatar Richard Cordovano Committed by GitHub
Browse files

Merge pull request #1658 from APriestman/5640_emptyParenBug

5640 Check that ID list is not empty
parents e70e2aca f94f66b4
No related branches found
No related tags found
No related merge requests found
...@@ -805,6 +805,10 @@ public Set<Long> updateEventsForArtifactTagDeleted(BlackboardArtifact artifact) ...@@ -805,6 +805,10 @@ public Set<Long> updateEventsForArtifactTagDeleted(BlackboardArtifact artifact)
} }
private void updateEventSourceTaggedFlag(CaseDbConnection conn, Collection<Long> eventDescriptionIDs, int flagValue) throws TskCoreException { private void updateEventSourceTaggedFlag(CaseDbConnection conn, Collection<Long> eventDescriptionIDs, int flagValue) throws TskCoreException {
if (eventDescriptionIDs.isEmpty()) {
return;
}
String sql = "UPDATE tsk_event_descriptions SET tagged = " + flagValue + " WHERE event_description_id IN (" + buildCSVString(eventDescriptionIDs) + ")"; //NON-NLS String sql = "UPDATE tsk_event_descriptions SET tagged = " + flagValue + " WHERE event_description_id IN (" + buildCSVString(eventDescriptionIDs) + ")"; //NON-NLS
try (Statement updateStatement = conn.createStatement()) { try (Statement updateStatement = conn.createStatement()) {
updateStatement.executeUpdate(sql); updateStatement.executeUpdate(sql);
...@@ -831,12 +835,16 @@ public Set<Long> updateEventsForHashSetHit(Content content) throws TskCoreExcept ...@@ -831,12 +835,16 @@ public Set<Long> updateEventsForHashSetHit(Content content) throws TskCoreExcept
caseDB.acquireSingleUserCaseWriteLock(); caseDB.acquireSingleUserCaseWriteLock();
try (CaseDbConnection con = caseDB.getConnection(); Statement updateStatement = con.createStatement();) { try (CaseDbConnection con = caseDB.getConnection(); Statement updateStatement = con.createStatement();) {
Map<Long, Long> eventIDs = getEventAndDescriptionIDs(con, content.getId(), true); Map<Long, Long> eventIDs = getEventAndDescriptionIDs(con, content.getId(), true);
String sql = "UPDATE tsk_event_descriptions SET hash_hit = 1" + " WHERE event_description_id IN (" + buildCSVString(eventIDs.values()) + ")"; //NON-NLS if (! eventIDs.isEmpty()) {
try { String sql = "UPDATE tsk_event_descriptions SET hash_hit = 1" + " WHERE event_description_id IN (" + buildCSVString(eventIDs.values()) + ")"; //NON-NLS
updateStatement.executeUpdate(sql); //NON-NLS try {
updateStatement.executeUpdate(sql); //NON-NLS
return eventIDs.keySet();
} catch (SQLException ex) {
throw new TskCoreException("Error setting hash_hit of events.", ex);//NON-NLS
}
} else {
return eventIDs.keySet(); return eventIDs.keySet();
} catch (SQLException ex) {
throw new TskCoreException("Error setting hash_hit of events.", ex);//NON-NLS
} }
} catch (SQLException ex) { } catch (SQLException ex) {
throw new TskCoreException("Error setting hash_hit of events.", ex);//NON-NLS throw new TskCoreException("Error setting hash_hit of events.", ex);//NON-NLS
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment