Commit 58a16d5
fix(spdx): Fix an issue with traversing nodes with the graph navigator
The node reference get invalidate after the scope passed to
`visitDependencies()` is left. This results in the tree not being
properly traversed, the map returned by
`getLinkageTypesForDependencyRelationships()` lacks some keys, which in
turn breaks the assumption made by a `getValue()` on that map [^1],
which leads to a crash.
Fix the traversal by simply executing the mapping to stable references
within the scope of validity of the node references.
[^1]: https://github.com/oss-review-toolkit/ort/blob/75891a2d28ea59be4808f5b41dadeaa60ebd288d/plugins/reporters/spdx/src/main/kotlin/SpdxDocumentModelMapper.kt#L74
Signed-off-by: Frank Viernau <frank.viernau@gmail.com>1 parent 75891a2 commit 58a16d5
1 file changed
Lines changed: 5 additions & 1 deletion
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
235 | 235 | | |
236 | 236 | | |
237 | 237 | | |
238 | | - | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
239 | 243 | | |
240 | 244 | | |
241 | 245 | | |
| |||
0 commit comments