diff options
author | daniel oeh <daniel.oeh@gmail.com> | 2013-09-06 19:42:16 +0200 |
---|---|---|
committer | daniel oeh <daniel.oeh@gmail.com> | 2013-09-06 19:42:16 +0200 |
commit | 38d1f02cc57a829e8c71b715fe1f838e35a7a8c3 (patch) | |
tree | 62e96303f52380f439e91891a739d120cc47b577 | |
parent | 7926494d7657482df83a898750f7cb33f517e041 (diff) | |
download | AntennaPod-38d1f02cc57a829e8c71b715fe1f838e35a7a8c3.zip |
Fixed occasional NullPointerException in PlaybackController/ExternalPlayerFragment
-rw-r--r-- | src/de/danoeh/antennapod/fragment/ExternalPlayerFragment.java | 5 | ||||
-rw-r--r-- | src/de/danoeh/antennapod/util/playback/PlaybackController.java | 11 |
2 files changed, 11 insertions, 5 deletions
diff --git a/src/de/danoeh/antennapod/fragment/ExternalPlayerFragment.java b/src/de/danoeh/antennapod/fragment/ExternalPlayerFragment.java index 933263d7d..3f967bbbe 100644 --- a/src/de/danoeh/antennapod/fragment/ExternalPlayerFragment.java +++ b/src/de/danoeh/antennapod/fragment/ExternalPlayerFragment.java @@ -138,7 +138,10 @@ public class ExternalPlayerFragment extends Fragment { @Override public void loadMediaInfo() { - ExternalPlayerFragment.this.loadMediaInfo(); + ExternalPlayerFragment fragment = ExternalPlayerFragment.this; + if (fragment != null) { + fragment.loadMediaInfo(); + } } @Override diff --git a/src/de/danoeh/antennapod/util/playback/PlaybackController.java b/src/de/danoeh/antennapod/util/playback/PlaybackController.java index f5d1847b3..017a0cd5b 100644 --- a/src/de/danoeh/antennapod/util/playback/PlaybackController.java +++ b/src/de/danoeh/antennapod/util/playback/PlaybackController.java @@ -273,10 +273,13 @@ public abstract class PlaybackController { public void onServiceConnected(ComponentName className, IBinder service) { playbackService = ((PlaybackService.LocalBinder) service) .getService(); - - queryService(); - if (AppConfig.DEBUG) - Log.d(TAG, "Connection to Service established"); + if (!released) { + queryService(); + if (AppConfig.DEBUG) + Log.d(TAG, "Connection to Service established"); + } else { + Log.i(TAG, "Connection to playback service has been established, but controller has already been released"); + } } @Override |