MDL-41034 Additional check to be extra sure that no JS error occurs
authorMarina Glancy <marina@moodle.com>
Tue, 6 Aug 2013 10:59:21 +0000 (20:59 +1000)
committerMarina Glancy <marina@moodle.com>
Tue, 6 Aug 2013 10:59:21 +0000 (20:59 +1000)
lib/editor/tinymce/plugins/managefiles/tinymce/editor_plugin.js

index 470af78..7e7b9cb 100644 (file)
 
             var managefiles = ed.getParam('managefiles', {});
             // Get draft area id from filepicker options.
-            if (!managefiles.itemid && M.editor_tinymce.filepicker_options 
-                    && M.editor_tinymce.filepicker_options[ed.id] 
-                    && M.editor_tinymce.filepicker_options[ed.id].image) {
+            if (!managefiles.itemid && M.editor_tinymce.filepicker_options
+                    && M.editor_tinymce.filepicker_options[ed.id]
+                    && M.editor_tinymce.filepicker_options[ed.id].image
+                    && M.editor_tinymce.filepicker_options[ed.id].image.itemid) {
                 managefiles.itemid = M.editor_tinymce.filepicker_options[ed.id].image.itemid;
                 ed.settings['managefiles'].itemid = managefiles.itemid;
             }