some defensive programming
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 2 Jun 2010 21:34:55 +0000 (21:34 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 2 Jun 2010 21:34:55 +0000 (21:34 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@16564 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/server/main/ws_info.xul

index 0e27a66..8d634b6 100644 (file)
             util.widgets.remove_children( x );
 
             var default_lib = g.my_lib; 
-            if (typeof g.my_libs_ou_hash[ default_lib ] == 'undefined') {
-                default_lib = null;
-            } else {
-                if ( !get_bool( g.aout_hash[ g.my_libs_ou_hash[ default_lib ].ou_type() ].can_have_users() ) ) {
+            try {
+                if (typeof g.my_libs_ou_hash[ default_lib ] == 'undefined') {
                     default_lib = null;
+                } else {
+                    if ( !get_bool( g.aout_hash[ g.my_libs_ou_hash[ default_lib ].ou_type() ].can_have_users() ) ) {
+                        default_lib = null;
+                    }
                 }
+            } catch(E) {
+                dump('Error in ws_info.xul, render_menulist(): ' + E + '\n');
+                default_lib = null;
             }
 
             g.ml = util.widgets.make_menulist(