File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
src/main/java/org/jenkinsci/plugins/pipeline/github Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 66import org .eclipse .egit .github .core .CommitStatus ;
77import org .eclipse .egit .github .core .RepositoryCommit ;
88import org .eclipse .egit .github .core .RepositoryId ;
9+ import org .eclipse .egit .github .core .User ;
910import org .jenkinsci .plugins .pipeline .github .client .ExtendedCommitComment ;
1011import org .jenkinsci .plugins .pipeline .github .client .ExtendedCommitService ;
1112import org .jenkinsci .plugins .scriptsecurity .sandbox .whitelists .Whitelisted ;
1617import java .util .Collection ;
1718import java .util .Map ;
1819import java .util .Objects ;
20+ import java .util .Optional ;
1921import java .util .stream .Stream ;
2022import java .util .stream .StreamSupport ;
2123
@@ -68,12 +70,16 @@ public String getUrl() {
6870
6971 @ Whitelisted
7072 public String getAuthor () {
71- return commit .getAuthor ().getLogin ();
73+ return Optional .ofNullable (commit .getAuthor ())
74+ .map (User ::getLogin )
75+ .orElse (null );
7276 }
7377
7478 @ Whitelisted
7579 public String getCommitter () {
76- return commit .getCommitter ().getLogin ();
80+ return Optional .ofNullable (commit .getCommitter ())
81+ .map (User ::getLogin )
82+ .orElse (null );
7783 }
7884
7985 @ Whitelisted
You can’t perform that action at this time.
0 commit comments