mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-11-11 13:22:43 +00:00
Bug 5085: Returning an empty object instead of status 404 if a race has
no course attached (it's effectively an empty course)
This commit is contained in:
1 parent
27bbe314e6
commit
2cd884499e
1 file changed
+7
-6
+7
-6
@@ -142,14 +142,15 @@ public class CourseConfigurationResource extends AbstractSailingServerResource {
|
||||
courseBase = courseDesginFinder.analyze();
|
||||
}
|
||||
|
||||
final JSONObject jsonResult;
|
||||
if (courseBase == null) {
|
||||
return Response.status(Status.NOT_FOUND).entity("No course found for given race.").build();
|
||||
jsonResult = new JSONObject();
|
||||
} else {
|
||||
final CourseConfiguration courseConfiguration = getService().getCourseAndMarkConfigurationFactory()
|
||||
.createCourseConfigurationFromCourse(courseBase, regatta, tags);
|
||||
jsonResult = courseConfigurationJsonSerializer.serialize(courseConfiguration);
|
||||
}
|
||||
|
||||
final CourseConfiguration courseConfiguration = getService().getCourseAndMarkConfigurationFactory()
|
||||
.createCourseConfigurationFromCourse(courseBase, regatta, tags);
|
||||
|
||||
return Response.ok(courseConfigurationJsonSerializer.serialize(courseConfiguration).toJSONString()).build();
|
||||
return Response.ok(jsonResult.toJSONString()).build();
|
||||
}
|
||||
|
||||
@GET
|
||||
|
||||
Reference in new issue
Block a user