From 3f371364de16995d9586de0a6faa92bdb3c16f29 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. --- 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