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
|
@Override
|
||||||
public void close() throws IOException {
|
public void close() throws IOException {
|
||||||
try {
|
if (grizzlyServer != null) {
|
||||||
grizzlyServer.shutdown(1, TimeUnit.MINUTES).get();
|
try {
|
||||||
} catch (ExecutionException ex) {
|
grizzlyServer.shutdown(1, TimeUnit.MINUTES).get();
|
||||||
throw new IOException("Failed to stop grizzly server", ex.getCause());
|
} catch (ExecutionException ex) {
|
||||||
} catch (InterruptedException e) {
|
throw new IOException("Failed to stop grizzly server", ex.getCause());
|
||||||
// timeout
|
} catch (InterruptedException e) {
|
||||||
|
// timeout
|
||||||
|
}
|
||||||
|
grizzlyServer.shutdownNow();
|
||||||
}
|
}
|
||||||
grizzlyServer.shutdownNow();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue