Skip to content

Commit 413d107

Browse files
committed
Fixed #238
1 parent 927442a commit 413d107

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

core/src/main/java/xyz/gianlu/librespot/player/mixing/AudioSink.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,11 +224,14 @@ boolean start() throws LineUnavailableException {
224224
return false;
225225
}
226226

227-
void write(byte[] buffer, int len) throws IOException, LineUnavailableException, LineHelper.MixerException {
227+
void write(byte[] buffer, int len) throws IOException, LineHelper.MixerException {
228228
if (type == Type.MIXER) {
229-
line.write(buffer, 0, len);
229+
if (line != null) line.write(buffer, 0, len);
230230
} else if (type == Type.PIPE) {
231231
if (out == null) {
232+
if (pipe == null)
233+
throw new IllegalStateException();
234+
232235
if (!pipe.exists()) {
233236
try {
234237
Process p = new ProcessBuilder().command("mkfifo " + pipe.getAbsolutePath())

0 commit comments

Comments
 (0)