Skip to content

Commit 2c2fe37

Browse files
authored
Need to enforce images list validation
In some cases, for instance while running some tests via storyshot, we can get a blocker with this error message: `Error: Uncaught [TypeError: Cannot read property 'querySelectorAll' of undefined]` Adding `this.list &&` at the beginning of this test will avoid such of issues and let pass well the tests I would really appreciate that fix to be able to move forward from `0.25.2` of react-slick to the latest version Thanks
1 parent c2b148b commit 2c2fe37

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/inner-slider.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ export class InnerSlider extends React.Component {
304304
};
305305
checkImagesLoad = () => {
306306
let images =
307-
(this.list.querySelectorAll &&
307+
(this.list && this.list.querySelectorAll &&
308308
this.list.querySelectorAll(".slick-slide img")) ||
309309
[];
310310
let imagesCount = images.length,

0 commit comments

Comments
 (0)