From a51cf9302b65c6a0b546737d8343ba4d65ec93cd Mon Sep 17 00:00:00 2001 From: Andrew Robert Nicols Date: Tue, 19 Jun 2012 15:43:14 +0100 Subject: [PATCH 1/1] MDL-33862 Ensure that a chooserspan exists before trying to set it up --- course/yui/modchooser/modchooser.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/course/yui/modchooser/modchooser.js b/course/yui/modchooser/modchooser.js index 6b73e681d51..f2c7207c93e 100644 --- a/course/yui/modchooser/modchooser.js +++ b/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(""); chooserspan.get('children').each(function(node) { chooserlink.appendChild(node); -- 2.43.0