sachinchoolur / lightgallery.js

Full featured JavaScript image & video gallery. No dependencies
https://sachinchoolur.github.io/lightgallery.js/
Other
5.3k stars 596 forks source link

'a' is not defined when calling a slide number out of range #128

Closed ghost closed 3 years ago

ghost commented 5 years ago

When entering a "slide" value out of range (less than 0 or more than the total amount of available images), an exception will raise:

`TypeError: a is undefined lightgallery.min.js:4:5161

isVideo http://domain/js/lightgallery.min.js:4 init http://domain/js/lg-video.min.js:4 dispatch7jQuery

slide http://domain/js/lightgallery.min.js:4 init http://domain/js/lg-hash.min.js:4 dispatch2jQuery`

How to reproduce:

On any lightgallery image gallery, click on an image. The browser will display an URL like:

http://domain/something.html#lg=1&slide=8

Modify the slide number manually to anything less than 0 or more than the total amount of images available. i.e.: if you have 7 images available, set it to 8. An error will arise as described above.

Browser: Firefox 65.0.1 (64-bit) Mac OS (but happens on every browser).

Any help will be much appreciated!

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. If the issue is still valid for version 2.x, please re-open. Apologize for not responding on time. Thank you for your contributions.