Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

Commit

Permalink
fix(database): handle empty results
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Reed committed Sep 25, 2020
1 parent de649a9 commit 2c4e738
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/api/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ export class APIDatabase {
try {
const ret = await this.get(url, force);
if (ret) {
return ret.data.map((player: any) => new Player(player));
return ret?.data?.map((player: any) => new Player(player)) || [];
}
} catch (err) {
console.error('APIDatabase.players(): failed to get players', err);
Expand Down

0 comments on commit 2c4e738

Please sign in to comment.