From 25c8b10d32172b0dfdca94166df216fe3a6cb681 Mon Sep 17 00:00:00 2001 From: Julian Maurice Date: Tue, 11 Sep 2018 16:53:42 +0200 Subject: [PATCH] Bug 15219: Do not call escapeHtml on null values --- koha-tmpl/intranet-tmpl/prog/js/checkouts.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js index 7b292dd609..9c6ef36d5a 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js +++ b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js @@ -112,7 +112,7 @@ var renderers = { return title; }, itemtype: function (data, type, row) { - return row.itemtype_description.escapeHtml(); + return row.itemtype_description ? row.itemtype_description.escapeHtml() : ''; }, collection: function (data, type, row) { return row.collection ? row.collection.escapeHtml() : ''; @@ -121,13 +121,13 @@ var renderers = { return row.location ? row.location.escapeHtml() : ''; }, homebranch: function (data, type, row) { - return row.homebranch.escapeHtml(); + return row.homebranch ? row.homebranch.escapeHtml() : ''; }, issuedate: function (data, type, row) { return row.issuedate_formatted; }, branch: function (data, type, row) { - return row.branchname.escapeHtml(); + return row.branchname ? row.branchname.escapeHtml() : ''; }, itemcallnumber: function (data, type, row) { return row.itemcallnumber ? row.itemcallnumber.escapeHtml() : ''; @@ -270,10 +270,10 @@ var renderers = { }, patron: function (data, type, row) { return "" - + row.borrower.firstname.escapeHtml() + + (row.borrower.firstname ? row.borrower.firstname.escapeHtml() : '') + " " - + row.borrower.surname.escapeHtml() - + " (" + row.borrower.cardnumber.escapeHtml() + ")" + + (row.borrower.surname ? row.borrower.surname.escapeHtml() : '') + + " (" + (row.borrower.cardnumber ? row.borrower.cardnumber.escapeHtml() : '') + ")" } }; -- 2.17.1