Skip to content

Commit

Permalink
Allow mod/plugin author field to be null (#442)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucko committed Aug 12, 2024
1 parent 8017dbd commit 0eeba9e
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,14 @@ public String getAuthor() {
}

public PluginOrModMetadata toProto() {
return PluginOrModMetadata.newBuilder()
.setName(this.name)
.setVersion(this.version)
.setAuthor(this.author)
.build();
PluginOrModMetadata.Builder builder = PluginOrModMetadata.newBuilder().setName(this.name);
if (this.version != null) {
builder.setVersion(this.version);
}
if (this.author != null) {
builder.setAuthor(this.author);
}
return builder.build();
}

}

0 comments on commit 0eeba9e

Please sign in to comment.