From 23fb26e98bc52029a5c7287de1ffb695df99faac 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 | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js index 8a68cede21..9c6ef36d5a 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js +++ b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js @@ -112,25 +112,25 @@ 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.escapeHtml(); + return row.collection ? row.collection.escapeHtml() : ''; }, location: function (data, type, row) { - return row.location.escapeHtml(); + 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.escapeHtml(); + return row.itemcallnumber ? row.itemcallnumber.escapeHtml() : ''; }, charge: function (data, type, row) { if (!row.charge) row.charge = 0; @@ -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