Title: Errors in fatal_error_handler
Last modified: January 28, 2021

---

# Errors in fatal_error_handler

 *  [Marcus Downing](https://wordpress.org/support/users/marcusdowning/)
 * (@marcusdowning)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/errors-in-fatal_error_handler/)
 * I think the fatal_error_handler code is incorrect.
 * This registers a global error handler, with `window.onerror = function...`. The
   handler attempts to match the wording of the error, looking for deprecated jQuery
   functions.
 * It uses `msg.match()`, which returns either null or an array, but the code to
   check for results says:
 * `if ( typeof erroredFunction !== 'object' || typeof erroredFunction[1] === "undefined"
   || -1 === jQueryFunctions.indexOf( erroredFunction[1] ) )`
 * This doesn’t work when the result is null because `typeof null === "object"` 
   in JavaScript.

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [Bas Schuiling](https://wordpress.org/support/users/basszje/)
 * (@basszje)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/errors-in-fatal_error_handler/#post-13976074)
 * I came here by searching why I’m getting this error.
 * To add, the line is in admin.php line 96, this is the error:
 *     ```
       if ( typeof erroredFunction !== 'object' || typeof erroredFunction[1] === "undefined" || -1 === jQueryFunctions.indexOf( erroredFunction[1] ) ) {
                           return true;
       }
       ```
   
 * > Uncaught TypeError: erroredFunction is null
 * Hope that helps.
 *  [Benjamin Danon](https://wordpress.org/support/users/bndn/)
 * (@bndn)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/errors-in-fatal_error_handler/#post-14328339)
 * This error is [reported on Github too](https://github.com/WordPress/jquery-migrate-helper/issues/29).
   We have to add a condition to the line 289 of wp-content/plugins/enable-jquery-
   migrate-helper/class-jquery-migrate-helper.php to fix it:
 * `if ( erroredFunction === null || typeof erroredFunction !== 'object' || typeof
   erroredFunction[1] === "undefined" || -1 === jQueryFunctions.indexOf( erroredFunction[
   1] ) ) {`
    -  This reply was modified 5 years, 1 month ago by [Benjamin Danon](https://wordpress.org/support/users/bndn/).

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Errors in fatal_error_handler’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/enable-jquery-migrate-helper.svg)
 * [Enable jQuery Migrate Helper](https://wordpress.org/plugins/enable-jquery-migrate-helper/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/enable-jquery-migrate-helper/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/enable-jquery-migrate-helper/)
 * [Active Topics](https://wordpress.org/support/plugin/enable-jquery-migrate-helper/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/enable-jquery-migrate-helper/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/enable-jquery-migrate-helper/reviews/)

 * 2 replies
 * 3 participants
 * Last reply from: [Benjamin Danon](https://wordpress.org/support/users/bndn/)
 * Last activity: [5 years, 1 month ago](https://wordpress.org/support/topic/errors-in-fatal_error_handler/#post-14328339)
 * Status: not resolved