Permalink
Browse files

MDL-33862 Ensure that a chooserspan exists before trying to set it up

  • Loading branch information...
andrewnicols committed Jun 19, 2012
1 parent 5e3698f commit a51cf9302b65c6a0b546737d8343ba4d65ec93cd
Showing with 3 additions and 0 deletions.
  1. +3 −0 course/yui/modchooser/modchooser.js
@@ -100,6 +100,9 @@ YUI.add('moodle-course-modchooser', function(Y) {
},
_setup_for_section : function(section, sectionid) {
var chooserspan = section.one(CSS.SECTIONMODCHOOSER);
+ if (!chooserspan) {
+ return;
+ }
var chooserlink = Y.Node.create("<a href='#' />");
chooserspan.get('children').each(function(node) {
chooserlink.appendChild(node);

0 comments on commit a51cf93

Please sign in to comment.