From 5e2c7e89aba0b4b01e16f764ee9e8872b0f3e326 Mon Sep 17 00:00:00 2001 From: Kacper Ziubryniewicz Date: Sun, 29 Dec 2019 20:22:48 +0100 Subject: [PATCH] [Hotfix] Fix crashing in grades subject adapter. --- .../edziennik/ui/modules/grades/GradesSubjectAdapter.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/grades/GradesSubjectAdapter.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/grades/GradesSubjectAdapter.java index 96adefa7..27625b5a 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/grades/GradesSubjectAdapter.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/grades/GradesSubjectAdapter.java @@ -697,6 +697,9 @@ public class GradesSubjectAdapter extends ArrayAdapter i @NonNull @Override public View getView(int position, View convertView, @NonNull ViewGroup parent) { + if (position >= subjectList.size()) { + return convertView; + } ItemGradesSubjectModel model = subjectList.get(position); if (model == null) { //Toast.makeText(activity, "return convertView;", Toast.LENGTH_SHORT).show();