fix: if in register_shutdown_function

This commit is contained in:
vnmedeiros 2021-02-17 15:24:14 -03:00
parent 4813c5d59e
commit e9387a60d2
1 changed files with 7 additions and 1 deletions

View File

@ -292,8 +292,14 @@ abstract class Background_Process extends \Tainacan_WP_Background_Process {
register_shutdown_function(function() use($batch) {
$error = error_get_last();
if ( is_null($error) )
if ( is_null($error) ||
!is_array($error) ||
!isset($error['type']) ||
$error['type'] !== 1
) {
return;
}
$error_str = "Fatal error: " . json_encode($error);
if ( is_array($error) ) {