From 14613e63957778592f254d18c1b12d11de8c50d8 Mon Sep 17 00:00:00 2001 From: Timothy J Warren Date: Wed, 11 Mar 2020 15:12:10 -0400 Subject: [PATCH] Fix a method of Anilist Model --- src/API/Anilist/Model.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/API/Anilist/Model.php b/src/API/Anilist/Model.php index 3f02b4eb..60a82775 100644 --- a/src/API/Anilist/Model.php +++ b/src/API/Anilist/Model.php @@ -276,7 +276,7 @@ final class Model * this way is more accurate than getting the list item id * directly from the MAL id */ - private function getListIdFromMediaId(string $mediaId): string + private function getListIdFromMediaId(string $mediaId): ?string { $config = $this->container->get('config'); $anilistUser = $config->get(['anilist', 'username']); @@ -286,7 +286,9 @@ final class Model 'userName' => $anilistUser, ]); - return (string)$info['data']['MediaList']['id']; + $data = $info['data']['MediaList']; + + return ($data !== NULL) ? (string)$data['id'] : NULL; } /**