Page MenuHomeSoftware Heritage

D8912.diff
No OneTemporary

D8912.diff

diff --git a/java/src/main/java/org/softwareheritage/graph/utils/ListOriginContributors.java b/java/src/main/java/org/softwareheritage/graph/utils/ListOriginContributors.java
--- a/java/src/main/java/org/softwareheritage/graph/utils/ListOriginContributors.java
+++ b/java/src/main/java/org/softwareheritage/graph/utils/ListOriginContributors.java
@@ -87,11 +87,21 @@
nodeContributors = new HashSet<>();
}
+ Long personId;
if (nodeSWHID.getType() == SwhType.REV) {
- nodeContributors.add(underlyingGraph.getAuthorId(nodeId));
- nodeContributors.add(underlyingGraph.getCommitterId(nodeId));
+ personId = underlyingGraph.getAuthorId(nodeId);
+ if (personId != null) {
+ nodeContributors.add(personId);
+ }
+ personId = underlyingGraph.getCommitterId(nodeId);
+ if (personId != null) {
+ nodeContributors.add(personId);
+ }
} else if (nodeSWHID.getType() == SwhType.REL) {
- nodeContributors.add(underlyingGraph.getAuthorId(nodeId));
+ personId = underlyingGraph.getAuthorId(nodeId);
+ if (personId != null) {
+ nodeContributors.add(personId);
+ }
}
if (!reuseAncestorSet) {
diff --git a/swh/graph/tests/test_origin_contributors.py b/swh/graph/tests/test_origin_contributors.py
--- a/swh/graph/tests/test_origin_contributors.py
+++ b/swh/graph/tests/test_origin_contributors.py
@@ -33,7 +33,6 @@
swh:1:ori:83404f995118bd25774f4ac14422a8f175e7a054,0
swh:1:ori:83404f995118bd25774f4ac14422a8f175e7a054,2
swh:1:ori:8f50d3f60eae370ddbf85c86219c55108a350165,0
-swh:1:ori:8f50d3f60eae370ddbf85c86219c55108a350165,null
swh:1:ori:8f50d3f60eae370ddbf85c86219c55108a350165,1
swh:1:ori:8f50d3f60eae370ddbf85c86219c55108a350165,2
"""

File Metadata

Mime Type
text/plain
Expires
Thu, Jan 23, 2:10 AM (19 h, 52 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3214980

Event Timeline