--- orig/components/Lesson/LessonExercise/LessonExerciseItem/LessonExerciseItem.jsx 2021-10-11 20:29:07.983390638 -0300 +++ sources-gen/components/Lesson/LessonExercise/LessonExerciseItem/LessonExerciseItem.jsx 2021-10-11 14:15:46.480142077 -0300 @@ -91,12 +91,20 @@ ); + // XXX: Here is the problem. These exercises return inputType == 'VIDEO' + // even though they don't have any videos (videos == []) causing some + // code that assumes that there is a video inside videos to fail + // (the MediaInputVideo component.) case 'VIDEO': - return ( -
- -
- ); + // This "if" is our patch. If it isn't true, it fallsthrough to the default + // behaviour (returning null.) + if (data.content.videos.length > 0) { + return ( +
+ +
+ ); + } default: return null; }