mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-22 11:12:36 +01:00
Fix crash when gen blank video with no sub
This commit is contained in:
parent
5490b38132
commit
913308c390
@ -28,7 +28,13 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
UiUtil.FixFonts(this);
|
||||
|
||||
numericUpDownDurationMinutes.Value = Configuration.Settings.Tools.BlankVideoMinutes;
|
||||
var maxTimeP = subtitle?.Paragraphs.Where(p => !p.EndTime.IsMaxTime).Max(p => p.EndTime.TotalMilliseconds);
|
||||
|
||||
double? maxTimeP = null;
|
||||
if (subtitle?.Paragraphs != null && subtitle.Paragraphs.Count > 0)
|
||||
{
|
||||
maxTimeP = subtitle?.Paragraphs.Where(p => !p.EndTime.IsMaxTime).Max(p => p.EndTime.TotalMilliseconds);
|
||||
}
|
||||
|
||||
if (maxTimeP.HasValue && maxTimeP.Value / 1000 > 120)
|
||||
{
|
||||
var minutes = (int)maxTimeP.Value / 1000 / 60 + 1;
|
||||
|
Loading…
Reference in New Issue
Block a user