Merge pull request #24442 from woocommerce/fix-error-log-notice

Check if error_get_last() is not null
This commit is contained in:
Rodrigo Primo 2019-08-21 15:36:55 -03:00 committed by GitHub
commit 147307f1e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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 */