Guard use of 'media'

It can be null in this class, so we should make sure it isn't accessed if it is.

fixes AntennaPod/AntennaPod#972
This commit is contained in:
Tom Hennen 2015-06-27 10:05:33 -04:00
parent e332df4af5
commit 8399da878f
1 changed files with 1 additions and 1 deletions

View File

@ -555,7 +555,7 @@ public abstract class PlaybackController {
* Should be used by classes which implement the OnSeekBarChanged interface.
*/
public void onSeekBarStopTrackingTouch(SeekBar seekBar, float prog) {
if (playbackService != null) {
if (playbackService != null && media != null) {
playbackService.seekTo((int) (prog * media.getDuration()));
setupPositionObserver();
}