mirror of
https://github.com/nextcloud/android.git
synced 2024-11-22 13:15:35 +03:00
Fix NullPointerException in PreviewMediaFragment.
Added null-checks for mVideoPreview and mMediaServiceBinder. Resolves: #252
This commit is contained in:
parent
3f51da330d
commit
7b400995c9
1 changed files with 13 additions and 9 deletions
|
@ -248,17 +248,21 @@ public class PreviewMediaFragment extends FileFragment implements
|
|||
outState.putParcelable(PreviewMediaFragment.EXTRA_ACCOUNT, mAccount);
|
||||
|
||||
if (getFile().isVideo()) {
|
||||
mSavedPlaybackPosition = mVideoPreview.getCurrentPosition();
|
||||
mAutoplay = mVideoPreview.isPlaying();
|
||||
outState.putInt(PreviewMediaFragment.EXTRA_PLAY_POSITION, mSavedPlaybackPosition);
|
||||
outState.putBoolean(PreviewMediaFragment.EXTRA_PLAYING, mAutoplay);
|
||||
if (mVideoPreview != null) {
|
||||
mSavedPlaybackPosition = mVideoPreview.getCurrentPosition();
|
||||
mAutoplay = mVideoPreview.isPlaying();
|
||||
outState.putInt(PreviewMediaFragment.EXTRA_PLAY_POSITION, mSavedPlaybackPosition);
|
||||
outState.putBoolean(PreviewMediaFragment.EXTRA_PLAYING, mAutoplay);
|
||||
}
|
||||
}
|
||||
else {
|
||||
outState.putInt(
|
||||
PreviewMediaFragment.EXTRA_PLAY_POSITION,
|
||||
mMediaServiceBinder.getCurrentPosition());
|
||||
outState.putBoolean(
|
||||
PreviewMediaFragment.EXTRA_PLAYING, mMediaServiceBinder.isPlaying());
|
||||
if (mMediaServiceBinder != null) {
|
||||
outState.putInt(
|
||||
PreviewMediaFragment.EXTRA_PLAY_POSITION,
|
||||
mMediaServiceBinder.getCurrentPosition());
|
||||
outState.putBoolean(
|
||||
PreviewMediaFragment.EXTRA_PLAYING, mMediaServiceBinder.isPlaying());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue