v1.5.1 - Only tryClose if not null
This commit is contained in:
parent
0f641e115c
commit
c9fceaac0d
2 changed files with 2 additions and 1 deletions
|
|
@ -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 {
|
||||||
|
|
|
||||||
|
|
@ -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) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue