Skip to content

Commit

Permalink
Fix CurseForge rejecting files without relations.
Browse files Browse the repository at this point in the history
  • Loading branch information
Darkhax committed Nov 19, 2021
1 parent 1ecc6fd commit 436cb0a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,12 @@ private Metadata createMetadata() {
request.changelogType = TaskPublishCurseForge.parseString(this.changelogType);
request.displayName = TaskPublishCurseForge.parseString(this.displayName);
request.releaseType = TaskPublishCurseForge.parseString(this.releaseType);
request.relations = this.uploadRelations;

// Only set the relations if they actually exist. Curse doesn't like empty arrays here :upside_down:
if (!this.uploadRelations.getRelations().isEmpty()) {

request.relations = this.uploadRelations;
}

// If the parent is null this is a parent artifact.
if (this.parent == null) {
Expand All @@ -490,7 +495,7 @@ private Metadata createMetadata() {
// file. The curseFileId is null until the parent has been published.
request.parentFileID = this.parent.curseFileId;
}

return request;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@ public class Metadata {

@Expose
@SerializedName("relations") // Optional
public ProjectRelations relations = new ProjectRelations();
public ProjectRelations relations = null;
}

0 comments on commit 436cb0a

Please sign in to comment.