From da92032fee11d0ca80f20d5c14fafea4a6761ab3 Mon Sep 17 00:00:00 2001 From: John Hunter Date: Wed, 6 May 2020 15:19:07 +0100 Subject: [PATCH] Add fix from https://github.com/cferdinandi/gumshoe/pull/111 --- src/js/feature/gumshoe.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/js/feature/gumshoe.js b/src/js/feature/gumshoe.js index 4a5d48a..7b7324d 100644 --- a/src/js/feature/gumshoe.js +++ b/src/js/feature/gumshoe.js @@ -191,7 +191,9 @@ * @return {Boolean} If true, use the last item */ var useLastItem = function (item, settings) { - if (isAtBottom() && isInView(item.content, settings, true)) return true; + if (isAtBottom() && item && isInView(item.content, settings, true)) { + return true; + } return false; }; @@ -211,7 +213,7 @@ /** * Return the element for the active class toggle - * @param {Node} nav The navigation eleemnt + * @param {Node} nav The navigation element * @param {Object} settings The settings for this instantiation */ var getNodeToActivate = function (nav, settings) {