@@ -37,7 +37,7 @@ public class GlobalSearchHandler implements RequestHandler {
|
||||
Optional<AuthToken> tokenOptional =
|
||||
authTokenRepository.findByToken(statRequest.getToken());
|
||||
|
||||
if (tokenOptional.isPresent()) {
|
||||
if (tokenOptional.isEmpty()) {
|
||||
throw new IllegalArgumentException("User token is required");
|
||||
}
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ public class ViolationStatisticsHandler implements RequestHandler {
|
||||
Optional<AuthToken> tokenOptional =
|
||||
authTokenRepository.findByToken(statRequest.getToken());
|
||||
|
||||
if (tokenOptional.isPresent()) {
|
||||
if (tokenOptional.isEmpty()) {
|
||||
throw new IllegalArgumentException("User token is required");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user