From b7d51e573a2a87ec73034ec59f948f28dc8759c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Brey=20Vilas?= Date: Fri, 3 Dec 2021 16:50:37 +0100 Subject: [PATCH] FileDetailFragment: prevent NullPointerException if fileDetailSharingFragment is called too soon MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Álvaro Brey Vilas --- .../com/owncloud/android/ui/fragment/FileDetailFragment.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/com/owncloud/android/ui/fragment/FileDetailFragment.java b/src/main/java/com/owncloud/android/ui/fragment/FileDetailFragment.java index f93aebed06..08f14bf7e3 100644 --- a/src/main/java/com/owncloud/android/ui/fragment/FileDetailFragment.java +++ b/src/main/java/com/owncloud/android/ui/fragment/FileDetailFragment.java @@ -169,6 +169,9 @@ public class FileDetailFragment extends FileFragment implements OnClickListener, * @return reference to the {@link FileDetailSharingFragment} */ public FileDetailSharingFragment getFileDetailSharingFragment() { + if (binding == null) { + return null; + } return ((FileDetailTabAdapter) binding.pager.getAdapter()).getFileDetailSharingFragment(); }