diff --git a/code/src/database/MySQLSongReader.php b/code/src/database/MySQLSongReader.php index 86e4d65..68d2e5b 100644 --- a/code/src/database/MySQLSongReader.php +++ b/code/src/database/MySQLSongReader.php @@ -23,6 +23,10 @@ public function getSongById(int $id): array | false $sql->execute(); $result = $sql->fetch(PDO::FETCH_ASSOC); + if(!$result) { + return []; + } + return $result; } }