diff --git a/app/Repositories/LessonRepository.ts b/app/Repositories/LessonRepository.ts index a4c8688..4875996 100644 --- a/app/Repositories/LessonRepository.ts +++ b/app/Repositories/LessonRepository.ts @@ -202,7 +202,10 @@ export default class LessonRepository { /** * Delete files from disk */ - await this.Drive.delete(`videos/${lesson.video.name}`); + if (lesson.video) { + await this.Drive.delete(`videos/${lesson.video.name}`); + } + await this.deleteMaterials(lesson); /**