chore: conditional index access

This commit is contained in:
Cory Dransfeldt 2023-10-10 10:23:50 -07:00
parent 8edecf908d
commit bb44264198

View file

@ -72,7 +72,7 @@ export default async () => {
}) })
.then((data) => data.json()) .then((data) => data.json())
.catch() .catch()
const track = trackRes.data[0]['attributes'] const track = trackRes.data?.[0]['attributes']
return Response.json({ return Response.json({
artist: aliasArtist(track['artistName']), artist: aliasArtist(track['artistName']),