mirror of
https://github.com/scm-manager/scm-manager.git
synced 2026-01-27 01:39:09 +01:00
Prevent null search string
A request without search string will not prevented otherwise and therefore will lead to a NPE with an internal server error response (500).
This commit is contained in:
@@ -28,6 +28,7 @@ import lombok.Getter;
|
||||
|
||||
import javax.validation.constraints.Max;
|
||||
import javax.validation.constraints.Min;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import javax.ws.rs.DefaultValue;
|
||||
import javax.ws.rs.PathParam;
|
||||
@@ -41,6 +42,7 @@ public class SearchParameters {
|
||||
@Context
|
||||
private UriInfo uriInfo;
|
||||
|
||||
@NotNull
|
||||
@Size(min = 2)
|
||||
@QueryParam("q")
|
||||
private String query;
|
||||
|
||||
Reference in New Issue
Block a user