Skip to content

Commit

Permalink
Gfs/fix compare command null (#115)
Browse files Browse the repository at this point in the history
* Adds exception handling to certificate result parsing.

* Fixes CertificateCompare crash when comparing removed certs
  • Loading branch information
gfs committed Apr 16, 2019
1 parent a0500ba commit ca7ec02
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Lib/Collectors/Certificates/CertificateCompare.cs
Expand Up @@ -70,7 +70,7 @@ public override void Compare(string firstRunId, string secondRunId)

Log.Information("{0} {1} {2}",Strings.Get("Found"), addObjects.Count, Strings.Get("Created"));

var removeObjects = new List<string>();
var removeObjects = new List<CertificateResult>();
cmd = new SqliteCommand(SELECT_DELETED_SQL, DatabaseManager.Connection, DatabaseManager.Transaction);
cmd.Parameters.AddWithValue("@first_run_id", firstRunId);
cmd.Parameters.AddWithValue("@second_run_id", secondRunId);
Expand All @@ -93,7 +93,7 @@ public override void Compare(string firstRunId, string secondRunId)
ChangeType = CHANGE_TYPE.DELETED,
ResultType = RESULT_TYPE.CERTIFICATE
};
addObjects.Add(obj);
removeObjects.Add(obj);
InsertResult(obj);
}
}
Expand Down

0 comments on commit ca7ec02

Please sign in to comment.