Toolbar: Check if obj is set before using it.

Props pento.
See #44526.

Built from https://develop.svn.wordpress.org/trunk@43556


git-svn-id: http://core.svn.wordpress.org/trunk@43385 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Konstantin Obenland 2018-08-06 19:33:28 +00:00
parent aab929b8d6
commit 071984839c
3 changed files with 4 additions and 4 deletions

View File

@ -303,9 +303,9 @@ if ( typeof(jQuery) != 'undefined' ) {
* @return {void}
*/
var addEvent = function( obj, type, fn ) {
if ( typeof obj.addEventListener === 'function' ) {
if ( obj && typeof obj.addEventListener === 'function' ) {
obj.addEventListener( type, fn, false );
} else if ( typeof obj.attachEvent === 'function' ) {
} else if ( obj && typeof obj.attachEvent === 'function' ) {
obj.attachEvent( 'on' + type, function() {
return fn.call( obj, window.event );
} );

File diff suppressed because one or more lines are too long

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.0-alpha-43555';
$wp_version = '5.0-alpha-43556';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.