From c99f158d66dd7349324b1d327cbf8d1877a3ae6e 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 Signed-off-by: Mike Rylander --- 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 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 ""; }; } -- 2.11.0