From 3a6193e3c326b1c1fca49ef770d4107ba154c9fc 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 --- 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.20.1