Fixed scan runner in response

ref #67
This commit is contained in:
2021-01-07 16:38:41 +01:00
parent 30502ec949
commit e67d1c5697
3 changed files with 10 additions and 9 deletions

View File

@@ -29,7 +29,8 @@ export class ResponseRunner extends ResponseParticipant {
*/
public constructor(runner: Runner) {
super(runner);
this.distance = runner.scans.filter(scan => { scan.valid === true }).reduce((sum, current) => sum + current.distance, 0);
if (!runner.scans) { this.distance = 0 }
else { this.distance = runner.scans.filter(scan => { scan.valid === true }).reduce((sum, current) => sum + current.distance, 0); }
this.group = runner.group;
}
}