|  | @@ -145,7 +145,7 @@ class SubtitlesWriter(ResultWriter):
 | 
	
		
			
				|  |  |              if len(subtitle) > 0:
 | 
	
		
			
				|  |  |                  yield subtitle
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -        if "words" in result["segments"][0]:
 | 
	
		
			
				|  |  | +        if len(result["segments"]) > 0 and "words" in result["segments"][0]:
 | 
	
		
			
				|  |  |              for subtitle in iterate_subtitles():
 | 
	
		
			
				|  |  |                  subtitle_start = self.format_timestamp(subtitle[0]["start"])
 | 
	
		
			
				|  |  |                  subtitle_end = self.format_timestamp(subtitle[-1]["end"])
 |