Break out of focus() in cat/z3950.js if obj.active_services is undefined.
authorJason Stephenson <jstephenson@mvlc.org>
Wed, 11 Dec 2013 15:05:18 +0000 (10:05 -0500)
committerBen Shum <bshum@biblio.org>
Tue, 17 Dec 2013 19:40:10 +0000 (14:40 -0500)
Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
Signed-off-by: Ben Shum <bshum@biblio.org>
Open-ILS/xul/staff_client/server/cat/z3950.js

index 07763b2..d140e13 100644 (file)
@@ -495,6 +495,7 @@ cat.z3950.prototype = {
     'focus' : function() {
         var obj = this;
         var focus_me; var or_focus_me;
+        if (!obj.active_services) return;
         for (var i = 0; i < obj.active_services.length; i++) {
             if (obj.creds.hosts[ obj.data.server_unadorned ] && obj.creds.hosts[ obj.data.server_unadorned ].services[ obj.active_services[i] ]) {
                 var x = obj.creds.hosts[ obj.data.server_unadorned ].services[ obj.active_services[i] ].default_attr;