Skip to content
This repository has been archived by the owner on Jul 23, 2019. It is now read-only.

Commit

Permalink
fix: improve catalog consistency check
Browse files Browse the repository at this point in the history
  • Loading branch information
ia3andy authored and invincibleJai committed Aug 2, 2018
1 parent ea0d880 commit b7d8684
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/app/launcher/service/mission-runtime.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ export abstract class MissionRuntimeService {
return catalog.boosters.map(b => {
const runtime: CatalogRuntime = runtimeById[b.runtime];
const mission: CatalogMission = missionById[b.mission];
if (!mission || !runtime) {
const version = runtime && runtime.versions.find(v => v.id === b.version);
if (!mission || !runtime || !version) {
throw new Error(`Invalid catalog booster: ${JSON.stringify(b)}` );
}
return {
Expand All @@ -102,9 +103,9 @@ export abstract class MissionRuntimeService {
mission: mission,
runtime: runtime,
source: b.source,
version: runtime.versions.find(v => v.id === b.version)
version: version
};
})
});
}

getBoosters(): Observable<Booster[]> {
Expand Down

0 comments on commit b7d8684

Please sign in to comment.