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=c99f158d66dd7349324b1d327cbf8d1877a3ae6e;p=evergreen%2Fpines.git Prevent AutoGrid death using a certain helper with null OU fields Signed-off-by: Lebbeous Fogle-Weekley Signed-off-by: Mike Rylander --- diff --git a/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js b/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js index 0faa3ee996..9210b367b1 100644 --- a/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js +++ b/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js @@ -671,9 +671,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 ""; }; }