Fixed possible array out of bounds in the BoardEditor swipe away.

The lib seems to have a bug or something, do bounds checking.
captchafix
Florens Douwes 11 years ago
parent aee0398f16
commit 07004addf6
  1. 8
      Clover/src/org/floens/chan/ui/activity/BoardEditor.java

@ -97,9 +97,11 @@ public class BoardEditor extends Activity {
@Override @Override
public void onDismiss(ListView listView, int[] reverseSortedPositions) { public void onDismiss(ListView listView, int[] reverseSortedPositions) {
for (int position : reverseSortedPositions) { for (int position : reverseSortedPositions) {
Board b = adapter.getItem(position); if (position >= 0 && position < adapter.getCount()) {
adapter.remove(b); Board b = adapter.getItem(position);
b.saved = false; adapter.remove(b);
b.saved = false;
}
} }
adapter.notifyDataSetChanged(); adapter.notifyDataSetChanged();

Loading…
Cancel
Save