Skip to content

Commit

Permalink
Add a null check before trying to read what error was detected.
Browse files Browse the repository at this point in the history
Fixes #29.
  • Loading branch information
Clorith committed Apr 18, 2021
1 parent 72be4e7 commit a10e10f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion class-jquery-migrate-helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ public static function fatal_error_handler() {
var erroredFunction = msg.match( match_pattern );

// If there was no matching functions, do not try to downgrade.
if ( typeof erroredFunction !== 'object' || typeof erroredFunction[1] === "undefined" || -1 === jQueryFunctions.indexOf( erroredFunction[1] ) ) {
if ( null === erroredFunction || typeof erroredFunction !== 'object' || typeof erroredFunction[1] === "undefined" || -1 === jQueryFunctions.indexOf( erroredFunction[1] ) ) {
return true;
}

Expand Down

0 comments on commit a10e10f

Please sign in to comment.