Skip to content

Commit b7f99ad

Browse files
committed
🐞 bail if getPath returns falsey on init. #776
1 parent d2b25d9 commit b7f99ad

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

js/core.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,9 @@ proto.create = function() {
8989
this.pageIndex = 1; // default to first page
9090
this.loadCount = 0;
9191
this.updateGetPath();
92-
// bail if getPath not set
93-
if ( !this.getPath ) {
92+
// bail if getPath not set, or returns falsey #776
93+
var hasPath = this.getPath && this.getPath();
94+
if ( !hasPath ) {
9495
console.error('Disabling InfiniteScroll');
9596
return;
9697
}

0 commit comments

Comments
 (0)