Fix grizzly server null check

This commit is contained in:
Andrea Cavalli 2024-03-02 22:41:11 +01:00
parent dee9941a1f
commit 6e3c41f7c4
1 changed files with 9 additions and 7 deletions

View File

@ -91,6 +91,7 @@ public class DefaultWebhook implements Webhook, Closeable {
@Override
public void close() throws IOException {
if (grizzlyServer != null) {
try {
grizzlyServer.shutdown(1, TimeUnit.MINUTES).get();
} catch (ExecutionException ex) {
@ -101,3 +102,4 @@ public class DefaultWebhook implements Webhook, Closeable {
grizzlyServer.shutdownNow();
}
}
}