protect against null 'kids' var in for loop
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 18 Feb 2010 16:02:29 +0000 (16:02 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 18 Feb 2010 16:02:29 +0000 (16:02 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@15582 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/opac/common/js/org_utils.js

index 675a29e..9bc0cf4 100644 (file)
@@ -97,7 +97,7 @@ function orgIsMine(me, org) {
        if(!me || !org) return false;
        if(me.id() == org.id()) return true;
     var kids = me.children();
-       for( var i = 0; i < kids.legnth; i++ ) {
+       for( var i = 0; kids && i < kids.legnth; i++ ) {
                if(orgIsMine(kids[i], org))
                        return true;
        }