Potential fix for all remaining errors
All checks were successful
continuous-integration/drone/pr Build is passing

ref #190
This commit is contained in:
Nicolai Ort 2021-04-07 16:38:20 +02:00
parent 4a294b1e17
commit 377d5dadb2
2 changed files with 20 additions and 4 deletions

View File

@ -49,7 +49,15 @@ export class ResponseStatsOrgnisation implements IResponse {
public constructor(org: RunnerOrganization) {
this.name = org.name;
this.id = org.id;
this.distance = org.distance;
this.donationAmount = org.distanceDonationAmount;
try {
this.distance = org.distance;
} catch {
this.distance = -1;
}
try {
this.donationAmount = org.distanceDonationAmount;
} catch {
this.donationAmount = -1;
}
}
}

View File

@ -57,7 +57,15 @@ export class ResponseStatsTeam implements IResponse {
this.name = team.name;
this.id = team.id;
this.parent = team.parentGroup.toResponse();
this.distance = team.distance;
this.donationAmount = team.distanceDonationAmount;
try {
this.distance = team.distance;
} catch {
this.distance = -1;
}
try {
this.donationAmount = team.distanceDonationAmount;
} catch {
this.donationAmount = -1;
}
}
}