when no regatta is found for a leaderboard name but no secret to skip has been specified either, apply regular security checks instead of failing with an NPE

Change-Id: I54a540ec8adb6e1d0d364f5b55302edf068c336f
This commit is contained in:
Axel Uhl committed 2019-05-04 17:08:21 +02:00
1 parent 77c8925c5c
commit 78f5c70ead
1 file changed
+6 -4
@@ -884,10 +884,12 @@ public interface RacingEventService extends TrackedRegattaRegistry, RegattaFetch
result = false;
} else {
Regatta regatta = getRegattaByName(leaderboardName);
if (regatta == null && secret != null) {
logger.warning(
"Attempt to skip security checks using regatta secret \"" + secret + "\" for leaderboard \""
+ leaderboardName + "\", but a regatta with the same name could not be resolved");
if (regatta == null) {
if (secret != null) {
logger.warning(
"Attempt to skip security checks using regatta secret \"" + secret + "\" for leaderboard \""
+ leaderboardName + "\", but a regatta with the same name could not be resolved");
} // else regatta not found, but no secret specified either; checks won't be skipped, but no skipping was really requested
result = false;
} else {
result = Util.equalStringsWithEmptyIsNull(regatta.getRegistrationLinkSecret(), secret);