Merge pull request #12540 from nextcloud/bugfix/pop-sort-list-crash

BugFix Check emptiness of previousSortGroupState
This commit is contained in:
Alper Öztürk 2024-02-14 15:08:38 +01:00 committed by GitHub
commit dac1b46057
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 12 additions and 2 deletions

View file

@ -2486,7 +2486,12 @@ public class FileDisplayActivity extends FileActivity
* visibility earlier using {@link #setSortListGroup(boolean, boolean)}
*/
private void popSortListGroupVisibility() {
boolean popped = previousSortGroupState.pop();
showSortListGroup(popped);
showSortListGroup(false);
if (previousSortGroupState.isEmpty()) {
return;
}
previousSortGroupState.pop();
}
}

View file

@ -74,6 +74,7 @@ import com.owncloud.android.lib.resources.shares.ShareeUser;
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;
@ -160,6 +161,10 @@ public class OCFileListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
this.gridView = gridView;
mStorageManager = transferServiceGetter.getStorageManager();
if (activity instanceof FileDisplayActivity) {
((FileDisplayActivity) activity).showSortListGroup(true);
}
if (mStorageManager == null) {
mStorageManager = new FileDataStorageManager(user, activity.getContentResolver());
}