Fixed NPE where trying to play null file
Stack trace contains headset button handler, so I guess the media is not loaded correctly.
This commit is contained in:
parent
4551b1fbc9
commit
76f9040184
|
@ -243,7 +243,7 @@ public class LocalPSMP extends PlaybackServiceMediaPlayer {
|
|||
callback.onMediaChanged(false);
|
||||
if (stream) {
|
||||
mediaPlayer.setDataSource(media.getStreamUrl());
|
||||
} else if (new File(media.getLocalMediaUrl()).canRead()) {
|
||||
} else if (media.getLocalMediaUrl() != null && new File(media.getLocalMediaUrl()).canRead()) {
|
||||
mediaPlayer.setDataSource(media.getLocalMediaUrl());
|
||||
} else {
|
||||
throw new IOException("Unable to read local file " + media.getLocalMediaUrl());
|
||||
|
|
Loading…
Reference in New Issue