Merge pull request #3492 from NoelDeMartin/MOBILE-4081

MOBILE-4081 core: Fix negative swipe indexes
main
Dani Palou 2022-12-01 08:50:26 +01:00 committed by GitHub
commit ef42e642a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

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