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 @@ public function getWah(): string { 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 ""; } diff --git a/resources/views/components/wah.blade.php b/resources/views/components/wah.blade.php index cea770e..4312606 100644 --- a/resources/views/components/wah.blade.php +++ b/resources/views/components/wah.blade.php @@ -1,5 +1,10 @@
Image "stolen" from tinyfox.dev
+ @if ($wah !== "") + +Image "stolen" from tinyfox.dev
+ @else + +Unable to retrieve image
+ @endif