feat(frontend): gebruikersvriendelijkere foutmeldingen voor foutieve leerpaden
This commit is contained in:
parent
ac933df57b
commit
759282f1c6
7 changed files with 22 additions and 8 deletions
|
@ -93,7 +93,10 @@ export class LearningPath {
|
|||
const startNodeDtos = dto.nodes.filter((it) => it.start_node === true);
|
||||
if (startNodeDtos.length < 1) {
|
||||
// The learning path has no starting node -> use the first node.
|
||||
return dto.nodes[0];
|
||||
if (dto.nodes.length > 0) {
|
||||
return dto.nodes[0];
|
||||
}
|
||||
throw new Error("emptyLearningPath");
|
||||
} // The learning path has 1 or more starting nodes -> use the first start node.
|
||||
return startNodeDtos[0];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue