only close client if it was started

This commit is contained in:
kimchy 2010-07-25 10:28:27 +03:00
parent 77b6d1d8b8
commit 747aa2e30a
1 changed files with 3 additions and 1 deletions

View File

@ -85,6 +85,8 @@ public class AwsEc2Service extends AbstractLifecycleComponent<AwsEc2Service> {
}
@Override protected void doClose() throws ElasticSearchException {
client.shutdown();
if (client != null) {
client.shutdown();
}
}
}