Skip to content

Commit

Permalink
fix: error initializing library for one-page scroll without sliders
Browse files Browse the repository at this point in the history
Ensure proper handling of pages without sliders during initialization to avoid runtime errors.
  • Loading branch information
mr-ema committed Nov 18, 2024
1 parent 837bfd1 commit 745d757
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,12 +248,13 @@ export function getSliderListInElement(element) {

/**
* @param element {Element}
* @returns {NodeListOf<Element>}
* @returns {NodeListOf<Element>|null}
*/
export function getSingleSlidesInElementOrNull(element) {
const slides = element.querySelectorAll("." + constants.SINGLE_SLIDE_CLASS_NAME);
if (slides.length >= 1) return slides;

return slides;
return null;
}

/**
Expand Down

0 comments on commit 745d757

Please sign in to comment.