From 006ae7e8205e5333db6f5d8ae202000459cd488e Mon Sep 17 00:00:00 2001 From: phasefx Date: Fri, 10 Sep 2010 20:12:44 +0000 Subject: [PATCH] some defense in patron.util.set_penalty_css against unfleshed or partially fleshed users git-svn-id: svn://svn.open-ils.org/ILS/trunk@17589 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/xul/staff_client/server/patron/util.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Open-ILS/xul/staff_client/server/patron/util.js b/Open-ILS/xul/staff_client/server/patron/util.js index f3b3d4ca2..37be06448 100644 --- a/Open-ILS/xul/staff_client/server/patron/util.js +++ b/Open-ILS/xul/staff_client/server/patron/util.js @@ -672,6 +672,7 @@ patron.util.set_penalty_css = function(patron) { */ var penalties = patron.standing_penalties(); + if (!penalties) { penalties = []; } for (var i = 0; i < penalties.length; i++) { /* this comes from /opac/common/js/utils.js */ addCSSClass(document.documentElement,penalties[i].standing_penalty().name()); @@ -743,12 +744,12 @@ patron.util.set_penalty_css = function(patron) { if ( get_bool( patron.juvenile() ) ) addCSSClass(document.documentElement,'PATRON_JUVENILE'); else removeCSSClass(document.documentElement,'PATRON_JUVENILE'); - if (patron.mailing_address()) { + if (patron.mailing_address() && typeof patron.mailing_address() == 'object') { if (!get_bool(patron.mailing_address().valid())) { addCSSClass(document.documentElement,'PATRON_HAS_INVALID_ADDRESS'); } } - if (patron.billing_address()) { + if (patron.billing_address() && typeof patron.billing_address() == 'object') { if (!get_bool(patron.billing_address().valid())) { addCSSClass(document.documentElement,'PATRON_HAS_INVALID_ADDRESS'); } -- 2.11.0