Fix usage of stale vulnerability id in the DB after it was updated.
@@ -189,7 +189,7 @@ public class VulnerabilityStatementsProcessor extends Plugin {
metadataUtility.deleteVulnerabilityData(vulnerability.getId(), vulnerabilityId, dbContext);
}
if(!vulnerability.getValidatedPurls().isEmpty()) {
- metadataUtility.insertVulnerability(vulnerability, dbContext);
+ vulnerabilityId = metadataUtility.insertVulnerability(vulnerability, dbContext);
metadataUtility.insertPurls(vulnerabilityId, vulnerability.getValidatedPurls(), dbContext);
updatePackageVersions(null, dbContext);
}
