Skip to content

Commit

Permalink
Add safe navigator to captions check
Browse files Browse the repository at this point in the history
Encountered an issue on avalon-dev where `@master_file.captions`
returned nil instead of an empty Indexed file so the subsequent check
for content errored. This prevents the HLS manifest from generating,
causing streaming to fail. I think this will be encountered with any
item created after we changed how captions are created/stored. Adding
the safe navigator should take care of the issue.
  • Loading branch information
masaball committed Dec 7, 2023
1 parent ce1a5af commit 864485e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/views/master_files/hls_manifest.m3u8.erb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Unless required by applicable law or agreed to in writing, software distributed
#EXTM3U
<% if @master_file.has_captions? %>
<% captions_list = @master_file.supplemental_file_captions %>
<% captions_list.append(@master_file.captions) if @master_file.captions.content %>
<% captions_list.append(@master_file.captions) if @master_file.captions&.content %>
<% captions_list.each_with_index do |caption, index| %>
<% label = caption.is_a?(SupplementalFile) ? caption.label : 'English' %>
<% language = caption.is_a?(SupplementalFile) ? caption.language : 'en' %>
Expand Down

0 comments on commit 864485e

Please sign in to comment.