Skip to content

Commit

Permalink
Update BomUploadProcessingTask.java
Browse files Browse the repository at this point in the history
  • Loading branch information
sahibamittal committed Feb 12, 2024
1 parent f0fdd65 commit 16487a6
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,8 @@ private void processBom(final Context ctx, final File bomFile) throws BomConsump
try {
trx.begin();
final Project project = processMetadataComponent(ctx, pm, metadataComponent);
if (projectMetadata != null) {
if (projectMetadata != null && project.getMetadata() == null) {
projectMetadata.setProject(project);
qm.getPersistenceManager().makePersistent(projectMetadata);
}
final Map<ComponentIdentity, Component> persistentComponents =
Expand Down Expand Up @@ -507,12 +508,10 @@ private static Project processMetadataComponent(final Context ctx, final Persist
changed |= applyIfChanged(project, metadataComponent, Project::getExternalReferences, project::setExternalReferences);
changed |= applyIfChanged(project, metadataComponent, Project::getPurl, project::setPurl);
changed |= applyIfChanged(project, metadataComponent, Project::getSwidTagId, project::setSwidTagId);
changed |= applyIfChanged(project, metadataComponent, Project::getMetadata, project::setMetadata);
if (changed) {
pm.flush();
}
}

return project;
}

Expand Down

0 comments on commit 16487a6

Please sign in to comment.