diff --git a/app/src/main/java/com/emanuelef/remote_capture/adapters/AppsTogglesAdapter.java b/app/src/main/java/com/emanuelef/remote_capture/adapters/AppsTogglesAdapter.java index e63afed7c..b05d6abe0 100644 --- a/app/src/main/java/com/emanuelef/remote_capture/adapters/AppsTogglesAdapter.java +++ b/app/src/main/java/com/emanuelef/remote_capture/adapters/AppsTogglesAdapter.java @@ -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); + } } });