File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
controller-runtime/src/main/kotlin/app/simplecloud/controller/runtime/group Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,11 @@ class GroupService(
3434 groupRepository.find(request.group.name)
3535 ? : throw StatusException (Status .NOT_FOUND .withDescription(" This group does not exist" ))
3636 val group = Group .fromDefinition(request.group)
37+
38+ if (group.minMemory > group.maxMemory) {
39+ throw StatusException (Status .INVALID_ARGUMENT .withDescription(" Minimum memory must be smaller than maximum memory" ))
40+ }
41+
3742 try {
3843 groupRepository.save(group)
3944 } catch (e: Exception ) {
@@ -47,6 +52,11 @@ class GroupService(
4752 throw StatusException (Status .NOT_FOUND .withDescription(" This group already exists" ))
4853 }
4954 val group = Group .fromDefinition(request.group)
55+
56+ if (group.minMemory > group.maxMemory) {
57+ throw StatusException (Status .INVALID_ARGUMENT .withDescription(" Minimum memory must be smaller than maximum memory" ))
58+ }
59+
5060 try {
5161 groupRepository.save(group)
5262 } catch (e: Exception ) {
You can’t perform that action at this time.
0 commit comments