Transcripts crash fix on landscape mode
@@ -670,6 +670,7 @@ public class CourseUnitVideoFragment extends CourseUnitFragment
@Override
public void updateTranscript(@NonNull TimedTextObject subtitles) {
+ if (transcriptAdapter != null) {
transcriptAdapter.clear();
List<Caption> transcript = new ArrayList<>();
for (Map.Entry<Integer, Caption> entry : subtitles.captions.entrySet()) {
@@ -679,10 +680,12 @@ public class CourseUnitVideoFragment extends CourseUnitFragment
transcriptAdapter.notifyDataSetChanged();
updateUI(getResources().getConfiguration().orientation);
}
+ }
@Override
public void updateSelection(final int subtitleIndex) {
- if (!isTranscriptScrolling && !transcriptAdapter.isSelected(subtitleIndex)) {
+ if (transcriptAdapter != null && !isTranscriptScrolling
+ && !transcriptAdapter.isSelected(subtitleIndex)) {
transcriptAdapter.unselectAll();
transcriptAdapter.select(subtitleIndex);
transcriptAdapter.notifyDataSetChanged();
