projects
/
sonitus.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix compatibility with Java 1.6.
[sonitus.git]
/
src
/
main
/
java
/
net
/
pterodactylus
/
sonitus
/
data
/
sink
/
Icecast2Sink.java
diff --git
a/src/main/java/net/pterodactylus/sonitus/data/sink/Icecast2Sink.java
b/src/main/java/net/pterodactylus/sonitus/data/sink/Icecast2Sink.java
index
cf098a9
..
3bf942e
100644
(file)
--- a/
src/main/java/net/pterodactylus/sonitus/data/sink/Icecast2Sink.java
+++ b/
src/main/java/net/pterodactylus/sonitus/data/sink/Icecast2Sink.java
@@
-160,7
+160,9
@@
public class Icecast2Sink implements Sink {
@Override
protected void finish() throws IOException {
Closeables.close(socketOutputStream, true);
@Override
protected void finish() throws IOException {
Closeables.close(socketOutputStream, true);
- Closeables.close(socket, true);
+ if (socket != null) {
+ socket.close();
+ }
}
}).start();
}
}).start();
@@
-200,9
+202,11
@@
public class Icecast2Sink implements Sink {
} finally {
try {
Closeables.close(socketOutputStream, true);
} finally {
try {
Closeables.close(socketOutputStream, true);
- Closeables.close(socket, true);
+ if (socket != null) {
+ socket.close();
+ }
} catch (IOException ioe1) {
} catch (IOException ioe1) {
- /* ignore
, will not happen
. */
+ /* ignore. */
}
}
}
}
}
}