Skip to content

Commit

Permalink
Fix possible NullPointerException 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 78f67e7
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 78f67e7

Please sign in to comment.