Skip to content

Commit

Permalink
Fix possible AppsTogglesAdapter in AppsTogglesAdapter
Browse files Browse the repository at this point in the history
  • Loading branch information
emanuele-f committed Apr 9, 2024
1 parent bc340af commit b18b9aa
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,12 @@ public AppsTogglesAdapter.AppViewHolder onCreateViewHolder(@NonNull ViewGroup pa
view.setOnClickListener((v) -> {
if(mRecyclerView != null) {
int pos = recyclerViewHolder.getAbsoluteAdapterPosition();
boolean checked = mCheckedItems.contains(getItem(pos).getPackageName());
handleToggle(pos, !checked);
AppDescriptor app = getItem(pos);

if (app != null) {
boolean checked = mCheckedItems.contains(app.getPackageName());
handleToggle(pos, !checked);
}
}
});

Expand Down

0 comments on commit b18b9aa

Please sign in to comment.