From 7858e5e9a80db532229fcb414183f16e3bb758de Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Wed, 3 Apr 2013 20:49:41 +0000 Subject: [PATCH] Prevent a JS error when working with embedded media in TinyMCE. props wonderboymusic. fixes #23876. git-svn-id: http://core.svn.wordpress.org/trunk@23895 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/js/tinymce/plugins/media/editor_plugin_src.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/js/tinymce/plugins/media/editor_plugin_src.js b/wp-includes/js/tinymce/plugins/media/editor_plugin_src.js index 2ca33ac0ed..b0dab1312d 100644 --- a/wp-includes/js/tinymce/plugins/media/editor_plugin_src.js +++ b/wp-includes/js/tinymce/plugins/media/editor_plugin_src.js @@ -438,7 +438,7 @@ } // Add HTML5 video element - if (typeItem.name === 'Video' && data.video.sources[0]) { + if (typeItem.name === 'Video' && data.video.sources && data.video.sources[0]) { // Create new object element video = new Node('video', 1).attr(tinymce.extend({ id : node.attr('id'), @@ -477,7 +477,7 @@ } // Add HTML5 audio element - if (typeItem.name === 'Audio' && data.video.sources[0]) { + if (typeItem.name === 'Audio' && data.video.sources && data.video.sources[0]) { // Create new object element audio = new Node('audio', 1).attr(tinymce.extend({ id : node.attr('id'),