diff --git a/src/API/Anilist/Model.php b/src/API/Anilist/Model.php index 1dfbbe37..00115399 100644 --- a/src/API/Anilist/Model.php +++ b/src/API/Anilist/Model.php @@ -269,12 +269,17 @@ final class Model */ private function getMediaIdFromMalId(string $malId, string $type = 'ANIME'): ?string { + if ($malId === '') + { + return NULL; + } + $info = $this->runQuery('MediaIdByMalId', [ 'id' => $malId, 'type' => mb_strtoupper($type), ]); - if (empty($info) || empty($info['data'])) + if (array_key_exists('errors', $info)) { return NULL; }