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'
|
||||
group = packagePath
|
||||
version '1.5.0'
|
||||
version '1.5.1'
|
||||
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_1_8
|
||||
|
||||
repositories {
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@ public class CloseableResult implements Closeable {
|
|||
* Attempts to close the closable, essentially wrapping it with try-catch.
|
||||
*/
|
||||
public void tryClose() {
|
||||
if (closeable == null) return;
|
||||
try {
|
||||
close();
|
||||
} catch (IOException ex) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue