From: Lebbeous Fogle-Weekley Date: Fri, 3 Feb 2012 19:45:28 +0000 (-0500) Subject: Prevent AutoGrid death using a certain helper with null OU fields X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=62b717d2ee599e6dd34c4e66938ef992ad961ba1;p=working%2FEvergreen.git Prevent AutoGrid death using a certain helper with null OU fields Signed-off-by: Lebbeous Fogle-Weekley --- diff --git a/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js b/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js index 921f97766d..0e8e8466e6 100644 --- a/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js +++ b/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js @@ -647,9 +647,12 @@ if(!dojo._hasResource['openils.widget.AutoGrid']) { openils.widget.AutoGrid.orgUnitGetter = function(rowIndex, item) { if (!item) return ""; - return fieldmapper.aou.findOrgUnit( - this.grid.store.getValue(item, this.field) - ).shortname(); + + var aou_id = this.grid.store.getValue(item, this.field); + if (aou_id) + return fieldmapper.aou.findOrgUnit(aou_id).shortname(); + else + return ""; }; }