diff --git a/lib/webvtt/parser.rb b/lib/webvtt/parser.rb index 5e590ce..49aa5bd 100644 --- a/lib/webvtt/parser.rb +++ b/lib/webvtt/parser.rb @@ -158,6 +158,9 @@ def parse # it's a note, ignore return if lines[0] =~ /NOTE/ + + # youtube loves empty lines + return if lines.nil? or lines[0].nil? if !lines[0].include?("-->") @identifier = lines[0]