(android) Fix NullPointerException in AudioPlayer.readyPlayer
authorTommi Ketola <tommi@keto.la>
Tue, 21 Feb 2017 10:33:21 +0000 (12:33 +0200)
committerShazron Abdullah <shazron@gmail.com>
Sat, 25 Feb 2017 02:05:50 +0000 (18:05 -0800)
 This closes #129

src/android/AudioPlayer.java

index 97d63fc..861421e 100644 (file)
@@ -590,7 +590,7 @@ public class AudioPlayer implements OnCompletionListener, OnPreparedListener, On
                     return true;
                 case MEDIA_STOPPED:
                     //if we are readying the same file
-                    if (this.audioFile.compareTo(file) == 0) {
+                    if (file!=null && this.audioFile.compareTo(file) == 0) {
                         //maybe it was recording?
                         if (player == null) {
                             this.player = new MediaPlayer();