mirror of
https://github.com/HangarMC/Hangar.git
synced 2024-12-21 06:51:19 +08:00
fix fake data service creating invalid projects
This commit is contained in:
parent
d82d0abbc4
commit
743dea6ad8
@ -26,6 +26,8 @@ public enum Category {
|
||||
MISC(9, "mdi-asterisk", "misc"),
|
||||
UNDEFINED(10, "", "undefined", false);
|
||||
|
||||
public static final List<Category> VALID_CATEGORIES = Arrays.stream(Category.values()).filter(c -> c != UNDEFINED).toList();
|
||||
|
||||
private final int value;
|
||||
private final String icon;
|
||||
private final boolean isVisible;
|
||||
|
@ -101,7 +101,7 @@ public class FakeDataService extends HangarComponent {
|
||||
final String projectName = this.normalize(this.faker.funnyName().name() + "_" + this.faker.minecraft().animalName());
|
||||
final String quote = this.faker.theItCrowd().quotes();
|
||||
final NewProjectForm newProject = new NewProjectForm(settings,
|
||||
Category.values()[this.faker.random().nextInt(Category.values().length)],
|
||||
Category.VALID_CATEGORIES.get(this.faker.random().nextInt(Category.VALID_CATEGORIES.size())),
|
||||
quote.substring(0, Math.min(quote.length(), 254)),
|
||||
ownerId,
|
||||
projectName.substring(0, Math.min(projectName.length(), 24)),
|
||||
|
Loading…
Reference in New Issue
Block a user