Merge pull request #3681 from ByteHamster/add-logging-feeditem

Parameter checking
This commit is contained in:
H. Lehmann 2019-12-13 12:39:41 +01:00 committed by GitHub
commit 32f7e73130
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -50,6 +50,9 @@ public class ItemPagerFragment extends Fragment {
* @return The ItemFragment instance
*/
public static ItemPagerFragment newInstance(long[] feeditems, int feedItemPos) {
if (feeditems.length <= feedItemPos) {
throw new IllegalArgumentException("Trying to show a feed item that is out of the list");
}
ItemPagerFragment fragment = new ItemPagerFragment();
Bundle args = new Bundle();
args.putLongArray(ARG_FEEDITEMS, feeditems);