File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -555,6 +555,11 @@ function ( $item ) {
555555 remove_filter ( 'site_transient_ ' . $ this ->upgrade_transient , $ transient_filter , 999 );
556556 }
557557
558+ if ( ! is_array ( $ result ) ) {
559+ // This should never happen, but bulk_upgrade() can return false.
560+ WP_CLI ::error ( 'Plugin upgrader is unable to connect to the filesystem. ' );
561+ }
562+
558563 /**
559564 * @var array $items_to_update
560565 */
@@ -609,7 +614,9 @@ static function ( $result ) {
609614 WP_CLI ::log ( "Skipped updates for: $ exclude " );
610615 }
611616
612- WP_CLI ::do_hook ( "{$ this ->item_type }_update_finished " , $ upgrader ->get_changed_files () );
617+ if ( isset ( $ upgrader ) ) {
618+ WP_CLI ::do_hook ( "{$ this ->item_type }_update_finished " , $ upgrader ->get_changed_files () );
619+ }
613620 }
614621
615622 // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore -- Whitelisting to provide backward compatibility to classes possibly extending this class.
You can’t perform that action at this time.
0 commit comments