From 36a162e0144b4fe056013b77f2679f1832ecffff Mon Sep 17 00:00:00 2001 From: Emmanuel Gautier Date: Mon, 3 Apr 2023 10:28:40 +0200 Subject: [PATCH] fix: log without response when response does not exist --- ps_accounts.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ps_accounts.php b/ps_accounts.php index 57e81d347..6d0209cf2 100644 --- a/ps_accounts.php +++ b/ps_accounts.php @@ -565,8 +565,11 @@ public function hookActionObjectShopDeleteBefore($params) try { $response = $accountsApi->deleteUserShop($params['object']->id); - - if (!$response || true !== $response['status']) { + if (!$response) { + $this->getLogger()->debug( + 'Error trying to DELETE shop : No $response object' + ); + } elseif (true !== $response['status']) { $this->getLogger()->debug( 'Error trying to DELETE shop : ' . $response['httpCode'] . ' ' . print_r($response['body']['message'], true)