Skip to content

Commit

Permalink
Don't do an request without the path
Browse files Browse the repository at this point in the history
  • Loading branch information
ah-net committed Dec 10, 2024
1 parent b876331 commit 9d61cb0
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions Controller/Ajax/Analytics.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,17 @@ public function execute()
$tweakwiseRequest->setPath('search');
}

try {
$this->client->request($tweakwiseRequest);
$result->setData(['success' => true]);
} catch (\Exception $e) {
$result->setData(['success' => false, 'message' => $e->getMessage()]);

if (!empty($tweakwiseRequest->getPath())) {
try {
$this->client->request($tweakwiseRequest);
$result->setData(['success' => true]);
} catch (\Exception $e) {
$result->setData([
'success' => false,
'message' => $e->getMessage()
]);
}
}
}

Expand Down

0 comments on commit 9d61cb0

Please sign in to comment.