MOBILE-3535 lesson: Fix undefined attempt if load fails

main
Dani Palou 2023-04-20 10:45:12 +02:00
parent 5646dd14e0
commit 6018868c75
1 changed files with 1 additions and 1 deletions

View File

@ -94,7 +94,7 @@ export class AddonModLessonUserRetakePage implements OnInit {
try { try {
await this.setRetake(retakeNumber); await this.setRetake(retakeNumber);
} catch (error) { } catch (error) {
this.selectedRetake = this.previousSelectedRetake; this.selectedRetake = this.previousSelectedRetake ?? this.selectedRetake;
CoreDomUtils.showErrorModal(CoreUtils.addDataNotDownloadedError(error, 'Error getting attempt.')); CoreDomUtils.showErrorModal(CoreUtils.addDataNotDownloadedError(error, 'Error getting attempt.'));
} finally { } finally {
this.loaded = true; this.loaded = true;