summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/jetpack/_inc/lib/core-api/class.jetpack-core-api-module-endpoints.php')
-rw-r--r--plugins/jetpack/_inc/lib/core-api/class.jetpack-core-api-module-endpoints.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/plugins/jetpack/_inc/lib/core-api/class.jetpack-core-api-module-endpoints.php b/plugins/jetpack/_inc/lib/core-api/class.jetpack-core-api-module-endpoints.php
index 458d2b6c..02a763ac 100644
--- a/plugins/jetpack/_inc/lib/core-api/class.jetpack-core-api-module-endpoints.php
+++ b/plugins/jetpack/_inc/lib/core-api/class.jetpack-core-api-module-endpoints.php
@@ -1329,7 +1329,12 @@ class Jetpack_Core_API_Module_Data_Endpoint {
}
$data = json_decode( base64_decode( $vaultpress->contact_service( 'plugin_data' ) ) );
- if ( is_wp_error( $data ) || ! isset( $data->backups->last_backup ) ) {
+ if ( false == $data ) {
+ return rest_ensure_response( array(
+ 'code' => 'not_registered',
+ 'message' => esc_html__( 'Could not connect to VaultPress.', 'jetpack' )
+ ) );
+ } else if ( is_wp_error( $data ) || ! isset( $data->backups->last_backup ) ) {
return $data;
} else if ( empty( $data->backups->last_backup ) ) {
return rest_ensure_response( array(