зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1317631 - Post: add more cursor position sanity checks r=sebastian
MozReview-Commit-ID: 7CBnLZDkExI --HG-- extra : rebase_source : e53b55da4dec0490cd64078fb196ed457f86da66
This commit is contained in:
Родитель
adc6f3ec51
Коммит
c8796d19d6
|
@ -49,8 +49,10 @@ public class StreamRecyclerAdapter extends RecyclerView.Adapter<StreamItem> impl
|
|||
return TopPanel.LAYOUT_ID;
|
||||
} else if (position == 1) {
|
||||
return StreamItem.HighlightsTitle.LAYOUT_ID;
|
||||
} else {
|
||||
} else if (position < getItemCount()) {
|
||||
return HighlightItem.LAYOUT_ID;
|
||||
} else {
|
||||
throw new IllegalArgumentException("Requested position does not exist");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -70,7 +72,7 @@ public class StreamRecyclerAdapter extends RecyclerView.Adapter<StreamItem> impl
|
|||
}
|
||||
|
||||
private int translatePositionToCursor(int position) {
|
||||
if (position == 0) {
|
||||
if (getItemViewType(position) != HighlightItem.LAYOUT_ID) {
|
||||
throw new IllegalArgumentException("Requested cursor position for invalid item");
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче