From 2a2fb81b5dbdee4c29207faf25ab8665f445340f Mon Sep 17 00:00:00 2001 From: Sam Wilson Date: Mon, 15 Dec 2025 09:52:07 +0800 Subject: [PATCH] Check for photoset's `has_requested_photos` before using Only photos owned by the user will be returned in has_requested_photos, otherwise the data is left off. This was resulting in the following error: > Fatal error: Uncaught TypeError: in_array(): Argument #2 ($haystack) must be of type array, null given --- src/PhotosApi.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/PhotosApi.php b/src/PhotosApi.php index 0e472c9..916d872 100644 --- a/src/PhotosApi.php +++ b/src/PhotosApi.php @@ -474,7 +474,8 @@ public function getSets($photoIds, $userId = null) } foreach ($sets['photoset'] as $photoset) { foreach ($photoIds as $photoId) { - if (in_array($photoId, $photoset['has_requested_photos'])) { + // has_requested_photos is only set if the user owns the photo. + if (in_array($photoId, $photoset['has_requested_photos'] ?? [])) { $out[] = $photoset; } }