Skip to content

Commit 8923e0c

Browse files
authored
fix: explicitely prevent self-references in dependency graph (#1472)
Signed-off-by: Jan Kowalleck <[email protected]>
1 parent af3178e commit 8923e0c

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

HISTORY.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ All notable changes to this project will be documented in this file.
66

77
<!-- unreleased changes go here -->
88

9+
* Fixed
10+
* Explicitly prevent self-reference dependency graph (via [#1472])
11+
12+
[#1472]: https://github.com/CycloneDX/cyclonedx-webpack-plugin/pull/1472
13+
914
## 5.2.2 - 2025-11-11
1015

1116
* Fixed

src/extractor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ export class Extractor {
129129
for (const [module, component] of modulesComponents) {
130130
for (const dependencyModule of module.dependencies.map(d => this.#compilation.moduleGraph.getModule(d)).filter(isNonNullable)) {
131131
const dependencyBomRef = modulesComponents.get(dependencyModule)?.bomRef
132-
if (dependencyBomRef !== undefined) {
132+
if (dependencyBomRef !== undefined && dependencyBomRef !== component.bomRef) {
133133
component.dependencies.add(dependencyBomRef)
134134
}
135135
}

0 commit comments

Comments
 (0)