Skip to content

Commit

Permalink
Add one more NPE check in AudioSPIPlayer
Browse files Browse the repository at this point in the history
  • Loading branch information
centic9 committed Nov 29, 2020
1 parent b60ee91 commit 6de7ed3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/java/org/dstadler/audio/player/AudioSPIPlayer.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ public void play() throws IOException {
int numbytes = 0; // how many bytes

for (; ; ) { // We'll exit the loop when we reach the end of stream
// bail out if the player was closed
if (ain == null) {
break;
}

// First, read some bytes from the input stream.
int bytesread = ain.read(buffer, numbytes, buffer.length - numbytes);

Expand Down

0 comments on commit 6de7ed3

Please sign in to comment.