aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorfloppydiskette <floppydisk@hyprcat.net>2024-12-09 20:48:27 +0000
committerfloppydiskette <floppydisk@hyprcat.net>2024-12-09 20:48:27 +0000
commit5596afa450ef2c4c98d033f5579955c8a4484157 (patch)
treec69ddf6ac4f1a65994d8641467d3ba5c22c43292 /app
parent27116d79ce70b07a1f6fb3c228fee5e61756107d (diff)
Handle no image being returned by tinyfox.dev
Diffstat (limited to 'app')
-rw-r--r--app/View/Components/Wah.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/View/Components/Wah.php b/app/View/Components/Wah.php
index 3b1d546..aeb5757 100644
--- a/app/View/Components/Wah.php
+++ b/app/View/Components/Wah.php
@@ -21,7 +21,9 @@ class Wah extends Component
try {
$response = Http::get('https://api.tinyfox.dev/img.json?animal=wah');
$data = $response->json();
- return "https://api.tinyfox.dev".$data["loc"];
+ if ($data == null) return "";
+ return "https://api.tinyfox.dev" . $data["loc"];
+
} catch (Exception $ex) {
return "";
}