Add a null pointer check for mMediaPlayer

It can happen...
This commit is contained in:
Christopher Eby 2010-04-05 17:20:28 -05:00
parent 87585922f2
commit 19cec7b0b6

View File

@ -302,8 +302,10 @@ public class PlaybackService extends Service implements Runnable, MediaPlayer.On
mScrobble = mSettings.getBoolean("scrobble", false);
} else if ("volume".equals(key)) {
float volume = mSettings.getFloat("volume", 1.0f);
synchronized (mMediaPlayer) {
mMediaPlayer.setVolume(volume, volume);
if (mMediaPlayer != null) {
synchronized (mMediaPlayer) {
mMediaPlayer.setVolume(volume, volume);
}
}
}
}