v1.5.1 - Only tryClose if not null

This commit is contained in:
Frank van der Heijden 2020-06-27 12:29:58 +02:00
parent 0f641e115c
commit c9fceaac0d
No known key found for this signature in database
GPG key ID: 26DA56488D314D11
2 changed files with 2 additions and 1 deletions

View file

@ -6,7 +6,7 @@ plugins {
String packagePath = 'net.frankheijden.serverutils' String packagePath = 'net.frankheijden.serverutils'
group = packagePath group = packagePath
version '1.5.0' version '1.5.1'
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_1_8 sourceCompatibility = targetCompatibility = JavaVersion.VERSION_1_8
repositories { repositories {

View file

@ -41,6 +41,7 @@ public class CloseableResult implements Closeable {
* Attempts to close the closable, essentially wrapping it with try-catch. * Attempts to close the closable, essentially wrapping it with try-catch.
*/ */
public void tryClose() { public void tryClose() {
if (closeable == null) return;
try { try {
close(); close();
} catch (IOException ex) { } catch (IOException ex) {