diff --git a/bot/src/main/java/de/chojo/gamejam/server/ServerService.java b/bot/src/main/java/de/chojo/gamejam/server/ServerService.java index 06baed3..23cdf5e 100644 --- a/bot/src/main/java/de/chojo/gamejam/server/ServerService.java +++ b/bot/src/main/java/de/chojo/gamejam/server/ServerService.java @@ -77,7 +77,7 @@ public void syncVelocity() { var req = HttpRequest.newBuilder(URI.create("http://%s:%d/v1/server".formatted(velocityHost, velocityPort))) .GET() .build(); - HttpResponse response; + HttpResponse response = null; var retries = 0; while (retries < 5) { try { @@ -95,6 +95,7 @@ public void syncVelocity() { throw new RuntimeException(e); } } + if(retries == 5) return; var collectionType = Mapper.MAPPER.getTypeFactory() .constructCollectionType(List.class, Registration.class); List registrations;