Skip to content

Commit

Permalink
check if iterator value is undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
zefir-git committed Sep 16, 2024
1 parent 2d43268 commit 3163745
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/resource/Artist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,11 @@ namespace Artist {
const iterations = Math.min(ids.size, 100);
const iterator = ids.values();
for (let i = 0; i < iterations; ++i) {
const artist = this.get(iterator.next().value)!;
if (artist !== null) artists.push(artist);
const id = iterator.next().value;
if (id === undefined) continue;
const artist = this.get(id)!;
if (artist === null) continue;
artists.push(artist);
}
return artists;
}
Expand Down

0 comments on commit 3163745

Please sign in to comment.