Skip to content

Commit

Permalink
Merge pull request sleuthkit#2917 from jayaramcs/ct-3.10.0
Browse files Browse the repository at this point in the history
OS Account where clause SQL error.
  • Loading branch information
jayaramcs authored Apr 30, 2024
2 parents 5619726 + aaca3d2 commit 8f9fa8a
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -794,8 +794,8 @@ OsAccountInstance newOsAccountInstance(long osAccountId, long dataSourceObjId, O
// It's possible that we weren't able to load the account instance because it
// is already in the database but the instance cache was cleared during an account merge.
// Try loading it here and re-adding to the cache.
String whereClause = "tsk_os_account_instances.os_account_obj_id = " + osAccountId
+ "AND tsk_os_account_instances.data_source_obj_id = " + dataSourceObjId;
String whereClause = " tsk_os_account_instances.os_account_obj_id = " + osAccountId
+ " AND tsk_os_account_instances.data_source_obj_id = " + dataSourceObjId;
List<OsAccountInstance> instances = getOsAccountInstances(whereClause);
if (instances.isEmpty()) {
throw new TskCoreException(String.format("Could not get autogen key after row insert or reload instance for OS account instance. OS account object id = %d, data source object id = %d", osAccountId, dataSourceObjId));
Expand Down Expand Up @@ -1525,7 +1525,7 @@ List<OsAccountAttribute> getOsAccountAttributes(OsAccount account) throws TskCor
* @throws TskCoreException
*/
public List<OsAccountInstance> getOsAccountInstances(OsAccount account) throws TskCoreException {
String whereClause = "tsk_os_account_instances.os_account_obj_id = " + account.getId();
String whereClause = " tsk_os_account_instances.os_account_obj_id = " + account.getId();
return getOsAccountInstances(whereClause);
}

Expand Down

0 comments on commit 8f9fa8a

Please sign in to comment.