Skip to content

Commit

Permalink
Merge pull request #12540 from nextcloud/bugfix/pop-sort-list-crash
Browse files Browse the repository at this point in the history
BugFix Check emptiness of previousSortGroupState
  • Loading branch information
alperozturk96 authored Feb 14, 2024
2 parents 4f22097 + 480ad5f commit dac1b46
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2486,7 +2486,12 @@ private void setSortListGroup(boolean currentListGroupVisibility, boolean show)
* visibility earlier using {@link #setSortListGroup(boolean, boolean)}
*/
private void popSortListGroupVisibility() {
boolean popped = previousSortGroupState.pop();
showSortListGroup(popped);
showSortListGroup(false);

if (previousSortGroupState.isEmpty()) {
return;
}

previousSortGroupState.pop();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
import com.owncloud.android.operations.RefreshFolderOperation;
import com.owncloud.android.operations.RemoteOperationFailedException;
import com.owncloud.android.ui.activity.ComponentsGetter;
import com.owncloud.android.ui.activity.FileDisplayActivity;
import com.owncloud.android.ui.fragment.SearchType;
import com.owncloud.android.ui.interfaces.OCFileListFragmentInterface;
import com.owncloud.android.ui.preview.PreviewTextFragment;
Expand Down Expand Up @@ -160,6 +161,10 @@ public OCFileListAdapter(
this.gridView = gridView;
mStorageManager = transferServiceGetter.getStorageManager();

if (activity instanceof FileDisplayActivity) {
((FileDisplayActivity) activity).showSortListGroup(true);
}

if (mStorageManager == null) {
mStorageManager = new FileDataStorageManager(user, activity.getContentResolver());
}
Expand Down

0 comments on commit dac1b46

Please sign in to comment.