diff --git a/wordpress.org/public_html/wp-content/plugins/wporg-gp-plugin-directory/inc/cli/class-set-plugin-project.php b/wordpress.org/public_html/wp-content/plugins/wporg-gp-plugin-directory/inc/cli/class-set-plugin-project.php
index 993d82add4..3742d04ff7 100644
--- a/wordpress.org/public_html/wp-content/plugins/wporg-gp-plugin-directory/inc/cli/class-set-plugin-project.php
+++ b/wordpress.org/public_html/wp-content/plugins/wporg-gp-plugin-directory/inc/cli/class-set-plugin-project.php
@@ -295,9 +295,13 @@ private function get_plugin_details( $slug ) {
)
);
- $details = $json && '{' == $json[0] ? json_decode( $json ) : null;
+ if ( ! json_validate( $json ) ) {
+ return null;
+ }
+
+ $details = json_decode( $json );
- if ( isset( $details->error ) ) {
+ if ( ! is_object( $details ) || isset( $details->error ) ) {
return null;
}