fix: TypeError: Cannot read properties of undefined (reading 'filter') - when trying to delete a org/team with runners

close #210
This commit is contained in:
Philipp Dormann 2025-03-28 21:14:14 +01:00
parent 78dcad0857
commit c4201e9a68
Signed by: philipp
GPG Key ID: 3BB9ADD52DCA4314

View File

@ -57,8 +57,11 @@ export class Runner extends Participant {
* This is implemented here to avoid duplicate code in other files. * This is implemented here to avoid duplicate code in other files.
*/ */
public get validScans(): Scan[] { public get validScans(): Scan[] {
if (this.scans) {
return this.scans.filter(scan => scan.valid == true); return this.scans.filter(scan => scan.valid == true);
} }
return []
}
/** /**
* Returns the total distance ran by this runner based on all his valid scans. * Returns the total distance ran by this runner based on all his valid scans.