Merge pull request #24442 from woocommerce/fix-error-log-notice
Check if error_get_last() is not null
This commit is contained in:
commit
147307f1e6
|
@ -199,7 +199,7 @@ final class WooCommerce {
|
|||
*/
|
||||
public function log_errors() {
|
||||
$error = error_get_last();
|
||||
if ( in_array( $error['type'], array( E_ERROR, E_PARSE, E_COMPILE_ERROR, E_USER_ERROR, E_RECOVERABLE_ERROR ), true ) ) {
|
||||
if ( $error && in_array( $error['type'], array( E_ERROR, E_PARSE, E_COMPILE_ERROR, E_USER_ERROR, E_RECOVERABLE_ERROR ), true ) ) {
|
||||
$logger = wc_get_logger();
|
||||
$logger->critical(
|
||||
/* translators: 1: error message 2: file name and path 3: line number */
|
||||
|
|
Loading…
Reference in New Issue