Merge pull request #9545 from nextcloud/fix/autoupload-check-crash

UploadFilesActivity: don't attempt to check selectAll if selectAll is not visible in menu
This commit is contained in:
Álvaro Brey 2021-12-15 11:28:32 +01:00 committed by GitHub
commit 587b371e76
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -462,14 +462,16 @@ public class UploadFilesActivity extends DrawerActivity implements LocalFileList
}
private void setSelectAllMenuItem(MenuItem selectAll, boolean checked) {
selectAll.setChecked(checked);
if (checked) {
selectAll.setIcon(R.drawable.ic_select_none);
} else {
selectAll.setIcon(
ThemeDrawableUtils.tintDrawable(R.drawable.ic_select_all, ThemeColorUtils.primaryColor(this)));
if (selectAll != null) {
selectAll.setChecked(checked);
if (checked) {
selectAll.setIcon(R.drawable.ic_select_none);
} else {
selectAll.setIcon(
ThemeDrawableUtils.tintDrawable(R.drawable.ic_select_all, ThemeColorUtils.primaryColor(this)));
}
updateUploadButtonActive();
}
updateUploadButtonActive();
}
@Override