fix: return early, if the photo is null everything wil fail anyway

This commit is contained in:
frederik
2024-07-10 20:42:38 +02:00
parent f7cc269495
commit 20c392b145
+2
View File
@@ -236,6 +236,8 @@ class Flickr {
} }
} }
if ($photo === null) return;
$license_url = "https://api.flickr.com/services/rest/?method=flickr.photos.getInfo&api_key=" . $this->flickr_api_key . "&photo_id=" . $photo["id"] . "&format=json&nojsoncallback=1"; $license_url = "https://api.flickr.com/services/rest/?method=flickr.photos.getInfo&api_key=" . $this->flickr_api_key . "&photo_id=" . $photo["id"] . "&format=json&nojsoncallback=1";
$license_response = file_get_contents($license_url); $license_response = file_get_contents($license_url);
$license_id = json_decode($license_response, true)["photo"]["license"]; $license_id = json_decode($license_response, true)["photo"]["license"];