Skip to content

Commit

Permalink
fix: Avoid possible NPE when revision's author is null.
Browse files Browse the repository at this point in the history
  • Loading branch information
sprevilla committed Aug 26, 2021
1 parent ccd8936 commit c478704
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ public RevisionsPanel (String ref, DB db) {
addStyleName(revisions.size() > 0 ? "revision-history" : "invisible");
}
private void addRevision (Revision r) {
Label author = new Label("<strong>" + r.getAuthor().getName() + "</strong>", ContentMode.HTML);
String auth = r.getAuthor() != null ? r.getAuthor().getName() : "author-unknown";
Label author = new Label("<strong>" + auth + "</strong>", ContentMode.HTML);
Label date = new Label(r.getDate().toString());
Label info = new Label(r.getInfo(), ContentMode.HTML);
author.setWidth("60%");
Expand Down

0 comments on commit c478704

Please sign in to comment.