From 7811505506fd27f98a10654a4e8a5ff1b69f149f Mon Sep 17 00:00:00 2001 From: Andrew Isherwood Date: Fri, 18 Jun 2021 10:59:01 +0100 Subject: [PATCH] Bug 27170: Fix bug with undefined 'links' If a row object doesn't have a 'links' property, calling 'length' on it will fail. This commit fixes this. Signed-off-by: Holly Cooper Signed-off-by: Barry Cannon Signed-off-by: Nick Clemens Signed-off-by: Jonathan Druart --- koha-tmpl/intranet-tmpl/prog/js/ill-availability.js | 2 +- koha-tmpl/opac-tmpl/bootstrap/js/ill-availability.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/js/ill-availability.js b/koha-tmpl/intranet-tmpl/prog/js/ill-availability.js index 8515200063..a7da26ba1c 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/ill-availability.js +++ b/koha-tmpl/intranet-tmpl/prog/js/ill-availability.js @@ -1,7 +1,7 @@ $(document).ready(function() { var getLinks = function(row) { - if (row.links.length === 0) { + if (row.links && row.links.length === 0) { return false; } return row.links.map(function(link) { diff --git a/koha-tmpl/opac-tmpl/bootstrap/js/ill-availability.js b/koha-tmpl/opac-tmpl/bootstrap/js/ill-availability.js index 239a3bfecd..9e4a57d6f4 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/js/ill-availability.js +++ b/koha-tmpl/opac-tmpl/bootstrap/js/ill-availability.js @@ -1,7 +1,7 @@ $(document).ready(function() { var getLinks = function(row) { - if (row.links.length === 0) { + if (row.links && row.links.length === 0) { return false; } return row.links.map(function(link) { -- 2.39.5