bah ... no implicit return from javascript function
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 25 Jun 2007 01:22:06 +0000 (01:22 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 25 Jun 2007 01:22:06 +0000 (01:22 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@7469 dcc99617-32d9-48b4-a31d-7c20da2025e4

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

index dff0c84..ea71cdc 100644 (file)
@@ -265,14 +265,9 @@ function grep ( code, list ) {
 
 function trim_ou_tree (tree, list) {
        for (var i in tree) {
-               if (
-                       grep(
-                               function(x) {x.id() == tree[i].ou_type()},
-                               ou_type_list
-                       )[0].can_have_users()
-               ) {
+               var type = grep( function(x) {return x.id() == tree[i].ou_type()}, ou_type_list )[0];
+               if ( type && type.can_have_users() )
                        list.push(tree[i]);
-               }
 
                if (tree[i].children()) trim_ou_tree(tree[i].children(), list);
        }