Skip to content

Commit 5c2549b

Browse files
committed
fix FileDetailsFragmentBinding.progressBlock' on a null object reference
Signed-off-by: alperozturk <[email protected]>
1 parent fec57f4 commit 5c2549b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

app/src/main/java/com/owncloud/android/ui/fragment/FileDetailFragment.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@ public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,
231231
}
232232

233233
binding = FileDetailsFragmentBinding.inflate(inflater, container, false);
234+
observeWorkerState();
234235
view = binding.getRoot();
235236

236237
if (getFile() == null || user == null) {
@@ -610,8 +611,6 @@ public void updateFileDetails(boolean transferring, boolean refresh) {
610611
if (view != null) {
611612
view.invalidate();
612613
}
613-
614-
observeWorkerState();
615614
}
616615

617616
@Subscribe(threadMode = ThreadMode.MAIN)
@@ -627,6 +626,10 @@ public void onDownloadProgress(FileDownloadProgressEvent event) {
627626

628627
private void observeWorkerState() {
629628
ActivityExtensionsKt.observeWorker(requireActivity(), state -> {
629+
if (binding == null) {
630+
return Unit.INSTANCE;
631+
}
632+
630633
if (state instanceof WorkerState.FileUploadStarted) {
631634
binding.progressText.setText(R.string.uploader_upload_in_progress_ticker);
632635
} else {

0 commit comments

Comments
 (0)