diff --git a/src/main/java/com/owncloud/android/ui/fragment/OCFileListFragment.java b/src/main/java/com/owncloud/android/ui/fragment/OCFileListFragment.java index 681e2dc75d..4c5174edbe 100644 --- a/src/main/java/com/owncloud/android/ui/fragment/OCFileListFragment.java +++ b/src/main/java/com/owncloud/android/ui/fragment/OCFileListFragment.java @@ -1538,12 +1538,16 @@ public class OCFileListFragment extends ExtendedListFragment implements OCFileLi } final FileDisplayActivity fileDisplayActivity = (FileDisplayActivity) getActivity(); - fileDisplayActivity.runOnUiThread(new Runnable() { - @Override - public void run() { - fileDisplayActivity.setIndeterminate(false); - } - }); + if (fileDisplayActivity != null) { + fileDisplayActivity.runOnUiThread(new Runnable() { + @Override + public void run() { + if (fileDisplayActivity != null) { + fileDisplayActivity.setIndeterminate(false); + } + } + }); + } } return remoteOperationResult.isSuccess();