Merge pull request #8654 from nextcloud/fix-npe-in-preview-media-fragment

Fix NPE when navigating out of PreviewMediaFragment during video loading
This commit is contained in:
Tobias Kaminsky 2021-07-16 12:02:54 +02:00 committed by GitHub
commit 5e83b6ca90
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -507,7 +507,7 @@ public class PreviewMediaFragment extends FileFragment implements OnTouchListene
protected void onPostExecute(Uri uri) {
final PreviewMediaFragment previewMediaFragment = previewMediaFragmentWeakReference.get();
final Context context = previewMediaFragment != null ? previewMediaFragment.getContext() : null;
if (previewMediaFragment != null && context != null) {
if (previewMediaFragment != null && previewMediaFragment.binding != null && context != null) {
if (uri != null) {
previewMediaFragment.videoUri = uri;