Browse Source

Catch errors when mapping MAL ids on sync

tags/v4.1.0
Timothy Warren 2 months ago
parent
commit
fec671e3cd
1 changed files with 6 additions and 1 deletions
  1. +6
    -1
      src/API/Anilist/Model.php

+ 6
- 1
src/API/Anilist/Model.php View File

@@ -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;
}

Loading…
Cancel
Save