[Android] Prevent NPE
Geoffrey Métais
git at videolan.org
Fri Feb 17 17:00:04 CET 2017
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri Feb 17 16:59:12 2017 +0100| [9896419f56e724b10e4c25aca968bc66caf0dd91] | committer: Geoffrey Métais
Prevent NPE
> https://code.videolan.org/videolan/vlc-android/commit/9896419f56e724b10e4c25aca968bc66caf0dd91
---
vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.java | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.java b/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.java
index 8df06d8..a366636 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.java
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.java
@@ -290,7 +290,10 @@ public class AudioPlayer extends PlaybackServiceFragment implements PlaybackServ
VLCApplication.runOnMainThread(new Runnable() {
@Override
public void run() {
- if (((AudioPlayerContainerActivity)getActivity()).isAudioPlayerExpanded())
+ AudioPlayerContainerActivity activity = (AudioPlayerContainerActivity) getActivity();
+ if (activity == null)
+ return;
+ if (activity.isAudioPlayerExpanded())
mBinding.header.setBackgroundResource(0);
mBinding.backgroundView.setColorFilter(UiTools.getColorFromAttribute(mBinding.backgroundView.getContext(), R.attr.audio_player_background_tint));
mBinding.backgroundView.setImageBitmap(blurredCover);
More information about the Android
mailing list