Skip to content

Commit 428f07a

Browse files
committed
fix #28
1 parent b5076f7 commit 428f07a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

platform_api/src/main/java/net/modfest/platform/service/SubmissionService.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
import org.jspecify.annotations.Nullable;
1212
import org.springframework.beans.factory.annotation.Autowired;
1313
import org.springframework.context.annotation.Lazy;
14+
import org.springframework.http.HttpStatus;
1415
import org.springframework.stereotype.Service;
16+
import org.springframework.web.server.ResponseStatusException;
1517

1618
import java.util.*;
1719
import java.util.stream.Collectors;
@@ -253,6 +255,11 @@ public SubmissionData makeSubmissionModrinth(String eventId, Set<UserData> autho
253255
throw new RuntimeException("submission already exists");
254256
}
255257

258+
if (project.sourceUrl == null || project.sourceUrl.isBlank()) {
259+
throw new ResponseStatusException(HttpStatus.BAD_REQUEST,
260+
"Modrinth submissions MUST have visible source code!");
261+
}
262+
256263
var latest = getLatestModrinth(subId, eventService.getEventById(eventId), project.projectType);
257264

258265
if (project.iconUrl != null) {

0 commit comments

Comments
 (0)