Browse Source

external buy service catch fix

master
gsd 10 months ago
parent
commit
ea9e7c46d9
  1. 7
      src/main/java/app/controllers/user/ProfileController.java

7
src/main/java/app/controllers/user/ProfileController.java

@ -132,7 +132,12 @@ public class ProfileController {
@RequestParam(value = "steam64", defaultValue = "") String steam64,
@RequestParam String buy_type,
@RequestParam(required = false, defaultValue = "") String cost) {
VipGiveMethod buy_type_enum = VipGiveMethod.valueOf(buy_type.toUpperCase());
VipGiveMethod buy_type_enum;
try {
buy_type_enum = VipGiveMethod.valueOf(buy_type.toUpperCase());
} catch (IllegalArgumentException err) {
return ResponseEntity.status(HttpStatus.CONFLICT).build();
}
if (!vipService.getServices().getOrDefault(buy_type, true)) {
return new ResponseEntity("Service " + buy_type_enum.name().toUpperCase() + " is not active long time", HttpStatus.OK);

Loading…
Cancel
Save