From 62b717d2ee599e6dd34c4e66938ef992ad961ba1 Mon Sep 17 00:00:00 2001 From: Lebbeous Fogle-Weekley Date: Fri, 3 Feb 2012 14:45:28 -0500 Subject: [PATCH] Prevent AutoGrid death using a certain helper with null OU fields Signed-off-by: Lebbeous Fogle-Weekley --- Open-ILS/web/js/dojo/openils/widget/AutoGrid.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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 ""; }; } -- 2.11.0