Skip to content

Commit

Permalink
fix: compilation issue after merging
Browse files Browse the repository at this point in the history
  • Loading branch information
koalamitice committed Feb 3, 2025
1 parent 5a6c3c9 commit 8330ae3
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ private <InputT, ResultT> Mono<ServerResponse> handleCompare(
var problemId = req.pathVariable(PROBLEM_ID_PARAM_NAME);
var problem = findProblemOrThrow(manager, problemId);

if (problem.getSolution() == null) {
if (problem.getSolution().isEmpty()) {
throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "Problem not solved yet!");
}

Expand All @@ -116,7 +116,7 @@ private <InputT, ResultT> Mono<ServerResponse> handleCompare(

float bound = problem.getBound().get().bound().value();
var pattern = Pattern.compile(manager.getType().getSolutionPattern());
var solutionMatcher = pattern.matcher(problem.getSolution().getSolutionData().toString());
var solutionMatcher = pattern.matcher(problem.getSolution().get().getSolutionData().toString());
float solutionValue;
if (solutionMatcher.find()) {
solutionValue = Float.parseFloat(solutionMatcher.group(1));
Expand All @@ -128,7 +128,7 @@ private <InputT, ResultT> Mono<ServerResponse> handleCompare(
ComparisonDto comparisonDto = new ComparisonDto(
comparison,
problem.getBound().get(),
problem.getSolution()
problem.getSolution().get()
);
return ok().body(Mono.just(comparisonDto), new ParameterizedTypeReference<>() {
});
Expand Down

0 comments on commit 8330ae3

Please sign in to comment.