Skip to content

Commit 03331f0

Browse files
committed
fix: PHP warning fix
1 parent c39d744 commit 03331f0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Updater/Update_Manager.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,12 @@ public function init_handlers(): void {
9191
* @return object|array|bool The result. Package info or false.
9292
*/
9393
public function display_package_info( object|array|bool $result, $action, object $args ): object|array|false {
94-
if ( ! in_array( $action, array( 'plugin_information', 'theme_information' ), true ) ) {
94+
$host = $this->get_hostname( $args->slug );
95+
if ( ! in_array( $action, array( 'plugin_information', 'theme_information' ), true ) || ! $host ) {
9596
return $result;
9697
}
9798

98-
$data = $this->handlers[ $this->get_hostname( $args->slug ) ]?->get_remote_data( $args->slug );
99+
$data = $this->handlers[ $host ]?->get_remote_data( $args->slug );
99100

100101
return $data ? (object) $data : $result;
101102
}

0 commit comments

Comments
 (0)