From: Llewellyn Marshall Date: Tue, 18 Apr 2023 18:14:56 +0000 (-0400) Subject: protection if grep in oils rpt tree returns null X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=6b128e7a70c574a174244e1f14d2c8c825811c12;p=working%2FEvergreen.git protection if grep in oils rpt tree returns null --- diff --git a/Open-ILS/web/reports/oils_rpt_tree.js b/Open-ILS/web/reports/oils_rpt_tree.js index 35dec1fcd6..b9bfa2c00c 100644 --- a/Open-ILS/web/reports/oils_rpt_tree.js +++ b/Open-ILS/web/reports/oils_rpt_tree.js @@ -18,11 +18,12 @@ function oilsLoadRptTree(callback) { } function oilsRptFindField(node, field) { - return grep( node.fields, + var g = grep( node.fields, function(f) { return (f.name == field); } - )[0]; + ); + return g ? g[0] : []; }