Commit d77be140 authored by Romain DELEAU's avatar Romain DELEAU

fix: error when loading a file with an empty ObjectiveReward

parent 8a8a8778
......@@ -49,6 +49,7 @@ import { InterrogativeSentence } from './class/sentence/interrogativeSentence/in
import { DeclarativeSentence } from './class/sentence/declarativeSentence/declarative-sentence';
import { ObjectReward } from './class/rewards/object-reward/object-reward';
import { DiscussionReward } from './class/rewards/discussion-reward/discussion-reward';
import { RoleEducationnalObjective } from './class/role-educationnal-objective/role-educationnal-objective';
@Component({
selector: 'app-root',
......@@ -272,6 +273,7 @@ export class AppComponent {
return Object.assign(new ObjectsReward(), rewardData);
}
if (rewardData.type == 'objective') {
rewardData.objective = Object.assign(new RoleEducationnalObjective(), rewardData.objective)
return Object.assign(new ObjectiveReward(), rewardData);
}
if (rewardData.type == 'other') {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment