Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F7147861
D8912.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
D8912.diff
View Options
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
Details
Attached
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
Attached To
D8912: ListOriginContributors: Ignore null author/committer in revisions/releases
Event Timeline
Log In to Comment