MOBILE-4081 core: Fix negative swipe indexes

main
Noel De Martin 2022-11-30 16:14:46 +01:00
parent 7990ca3e91
commit 747f23ba75
1 changed files with 5 additions and 1 deletions

View File

@ -129,7 +129,11 @@ export class CoreSwipeNavigationItemsManager<
while (deltaMoved !== delta) {
nextIndex += deltaStep;
if (nextIndex < 0 || nextIndex >= items.length) {
if (nextIndex < 0) {
return null;
}
if (nextIndex >= items.length) {
break;
}