Skip to content

Commit

Permalink
fix(api): fix issue where api has a location with no systems listed
Browse files Browse the repository at this point in the history
I think it may be possible for an account to have multiple locations, but have one empty. This
probably would happen if someone moved their system between sites, but
didn't delete the old site.

fix #310
  • Loading branch information
grivkees committed Sep 12, 2022
1 parent af0e872 commit ae9ff8d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/infinityApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ export class InfinityEvolutionLocations extends BaseInfinityEvolutionApiModel {
await this.fetch();
const systems: string[] = [];
for (const location of this.data_object.locations.location) {
for (const system of location.systems[0].system) {
for (const system of location.systems[0].system || []) {
const link_parts = system['atom:link'][0]['$']['href'].split('/');
systems.push(link_parts[link_parts.length - 1]);
}
Expand Down

0 comments on commit ae9ff8d

Please sign in to comment.