Fix grizzly server null check
This commit is contained in:
parent
dee9941a1f
commit
6e3c41f7c4
@ -91,13 +91,15 @@ public class DefaultWebhook implements Webhook, Closeable {
|
||||
|
||||
@Override
|
||||
public void close() throws IOException {
|
||||
try {
|
||||
grizzlyServer.shutdown(1, TimeUnit.MINUTES).get();
|
||||
} catch (ExecutionException ex) {
|
||||
throw new IOException("Failed to stop grizzly server", ex.getCause());
|
||||
} catch (InterruptedException e) {
|
||||
// timeout
|
||||
if (grizzlyServer != null) {
|
||||
try {
|
||||
grizzlyServer.shutdown(1, TimeUnit.MINUTES).get();
|
||||
} catch (ExecutionException ex) {
|
||||
throw new IOException("Failed to stop grizzly server", ex.getCause());
|
||||
} catch (InterruptedException e) {
|
||||
// timeout
|
||||
}
|
||||
grizzlyServer.shutdownNow();
|
||||
}
|
||||
grizzlyServer.shutdownNow();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user