Index: Source/core/html/HTMLMediaElement.cpp |
diff --git a/Source/core/html/HTMLMediaElement.cpp b/Source/core/html/HTMLMediaElement.cpp |
index 29a67a7b11065fab209b7ad7b989329a26b8ae6c..7f980b63dbf0229bebba1107adba9039a74c6844 100644 |
--- a/Source/core/html/HTMLMediaElement.cpp |
+++ b/Source/core/html/HTMLMediaElement.cpp |
@@ -3279,6 +3279,9 @@ void HTMLMediaElement::setTextTrackKindUserPreferenceForAllMediaElements(Documen |
void HTMLMediaElement::automaticTrackSelectionForUpdatedUserPreference() |
{ |
+ if (!m_textTracks || !m_textTracks->length()) |
+ return; |
+ |
markCaptionAndSubtitleTracksAsUnconfigured(); |
m_processingPreferenceChange = true; |
m_closedCaptionsVisible = false; |
@@ -3287,8 +3290,7 @@ void HTMLMediaElement::automaticTrackSelectionForUpdatedUserPreference() |
// If a track is set to 'showing' post performing automatic track selection, |
// set closed captions state to visible to update the CC button and display the track. |
- if (m_textTracks) |
- m_closedCaptionsVisible = m_textTracks->hasShowingTracks(); |
+ m_closedCaptionsVisible = m_textTracks->hasShowingTracks(); |
updateTextTrackDisplay(); |
} |