From da879f87bc17145355879129bed55d8129ed6dd1 Mon Sep 17 00:00:00 2001 From: Mason Ballengee Date: Tue, 5 Dec 2023 15:30:58 -0500 Subject: [PATCH] Add check for captions.content before appending file to captions list --- app/views/master_files/hls_manifest.m3u8.erb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/views/master_files/hls_manifest.m3u8.erb b/app/views/master_files/hls_manifest.m3u8.erb index 6dc4bd3965..47eb8c5f18 100644 --- a/app/views/master_files/hls_manifest.m3u8.erb +++ b/app/views/master_files/hls_manifest.m3u8.erb @@ -15,7 +15,9 @@ Unless required by applicable law or agreed to in writing, software distributed %> #EXTM3U <% if @master_file.has_captions? %> -<% @master_file.supplemental_file_captions.append(@master_file.captions).each_with_index do |caption, index| %> +<% captions_list = @master_file.supplemental_file_captions %> +<% 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' %> <% id = caption.is_a?(SupplementalFile) ? caption.id : 'master_file_caption' %>