protect against empty list items
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 9 Apr 2008 16:10:07 +0000 (16:10 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 9 Apr 2008 16:10:07 +0000 (16:10 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_1_2@9280 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/server/patron/user_edit.js

index 9f78774..c67d1f8 100644 (file)
@@ -286,6 +286,8 @@ function grep ( code, list ) {
 
 function trim_ou_tree (tree, list) {
        for (var i in tree) {
+               if (!tree) continue;
+
                var type = grep( function(x) {return x.id() == tree[i].ou_type()}, ou_type_list )[0];
                if ( type && type.can_have_users() == 't' )
                        list.push(tree[i]);