MDL-33186 Ensure that the comment textarea exists before toggling it
[moodle.git] / comment / comment.js
index dcf669e..a16b83a 100644 (file)
@@ -385,6 +385,9 @@ bodyContent: '<div class="comment-delete-confirm"><a href="#" id="confirmdelete-
             },
             toggle_textarea: function(focus) {
                 var t = Y.one('#dlg-content-'+this.client_id);
             },
             toggle_textarea: function(focus) {
                 var t = Y.one('#dlg-content-'+this.client_id);
+                if (!t) {
+                    return false;
+                }
                 if (focus) {
                     if (t.get('value') == M.str.moodle.addcomment) {
                         t.set('value', '');
                 if (focus) {
                     if (t.get('value') == M.str.moodle.addcomment) {
                         t.set('value', '');