From 4be49e560b4069432d1dc5db4d2c0fb754e9832f Mon Sep 17 00:00:00 2001 From: niksedk Date: Fri, 17 Dec 2021 03:07:45 +0100 Subject: [PATCH] Do not crash on missing total frames - thx SarahElGayyar :) Related to #5613 --- src/ui/Forms/GenerateVideoWithHardSubs.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/ui/Forms/GenerateVideoWithHardSubs.cs b/src/ui/Forms/GenerateVideoWithHardSubs.cs index a208e355d..e2fa00e06 100644 --- a/src/ui/Forms/GenerateVideoWithHardSubs.cs +++ b/src/ui/Forms/GenerateVideoWithHardSubs.cs @@ -234,9 +234,12 @@ namespace Nikse.SubtitleEdit.Forms File.WriteAllText(assaTempFileName, format.ToText(_assaSubtitle, null)); groupBoxSettings.Enabled = false; - progressBar1.Maximum = (int)_videoInfo.TotalFrames; - progressBar1.Visible = true; labelPleaseWait.Visible = true; + if (_videoInfo.TotalFrames > 0) + { + progressBar1.Maximum = (int)_videoInfo.TotalFrames; + progressBar1.Visible = true; + } if (checkBoxTargetFileSize.Checked) {