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 missing result properly
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Reed committed Sep 28, 2020
1 parent 65e807c commit f479aab
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 ? 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 f479aab

Please sign in to comment.