From f112f761c36530849c97dd2bb78caf00c895b397 Mon Sep 17 00:00:00 2001 From: Frode Petterson Date: Fri, 4 Aug 2017 11:04:10 +0200 Subject: [PATCH] Prevent JS error when no pager is available --- js/h5p-library-details.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/js/h5p-library-details.js b/js/h5p-library-details.js index 9d22167..e08b699 100644 --- a/js/h5p-library-details.js +++ b/js/h5p-library-details.js @@ -188,6 +188,10 @@ var H5PLibraryDetails= H5PLibraryDetails || {}; * Update the pager text, and enables/disables the next and previous buttons as needed */ H5PLibraryDetails.updatePager = function () { + if (!H5PLibraryDetails.$pagerInfo) { + return; // No pager available + } + H5PLibraryDetails.$pagerInfo.css({display: 'inline-block'}); if(H5PLibraryDetails.getNumPages() > 0) {