NOBUG Additional checking in navigation JavaScript
authorSam Hemelryk <sam@moodle.com>
Fri, 3 Sep 2010 05:53:47 +0000 (05:53 +0000)
committerSam Hemelryk <sam@moodle.com>
Fri, 3 Sep 2010 05:53:47 +0000 (05:53 +0000)
blocks/navigation/navigation.js

index 2ec2e8c..e4142ec 100644 (file)
@@ -212,7 +212,9 @@ M.block_navigation.classes.tree.prototype.add_branch = function(branchobj, targe
             if (branch.children[i].type == 20) {
                 count++;
             }
-            this.add_branch(branch.children[i], childrenul, depth+1);
+            if (typeof(branch.children[i])=='object') {
+                this.add_branch(branch.children[i], childrenul, depth+1);
+            }
         }
         if (branch.type == 10 && count >= M.block_navigation.courselimit) {
             var properties = Array();