mirror of
https://github.com/nextcloud/android.git
synced 2024-11-28 02:17:43 +03:00
Merge pull request #4577 from nextcloud/ezaquarii/fix-npe-in-preview-media-fragment
Fix NPE in PreviewMediaFragment
This commit is contained in:
commit
b204db0f1a
1 changed files with 4 additions and 3 deletions
|
@ -79,6 +79,7 @@ import javax.inject.Inject;
|
|||
import androidx.annotation.DrawableRes;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.StringRes;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
/**
|
||||
* This fragment shows a preview of a downloaded media file (audio or video).
|
||||
|
@ -510,9 +511,9 @@ public class PreviewMediaFragment extends FileFragment implements OnTouchListene
|
|||
|
||||
@Override
|
||||
protected void onPostExecute(Uri uri) {
|
||||
PreviewMediaFragment previewMediaFragment = previewMediaFragmentWeakReference.get();
|
||||
|
||||
if (previewMediaFragment != null) {
|
||||
final PreviewMediaFragment previewMediaFragment = previewMediaFragmentWeakReference.get();
|
||||
final Context context = previewMediaFragment != null ? previewMediaFragment.getContext() : null;
|
||||
if (previewMediaFragment != null && context != null) {
|
||||
if (uri != null) {
|
||||
previewMediaFragment.mVideoUri = uri;
|
||||
previewMediaFragment.mVideoPreview.setVideoURI(uri);
|
||||
|
|
Loading…
Reference in a new issue