Fix crash in RemoveUnneededSpaces

This commit is contained in:
Nikolaj Olsson 2020-03-07 13:23:38 +01:00
parent 44f111f5ce
commit 75f8ab6345

View File

@ -2084,7 +2084,7 @@ namespace Nikse.SubtitleEdit.Core
text = text.Trim();
text = text.Replace(Environment.NewLine + " ", Environment.NewLine);
if (text.Contains("-") && !text.StartsWith("--", StringComparison.Ordinal))
if (text.Contains("-") && text.Length > 2 && !text.StartsWith("--", StringComparison.Ordinal))
{
var dialogHelper = new DialogSplitMerge { DialogStyle = Configuration.Settings.General.DialogStyle };
text = dialogHelper.RemoveSpaces(text);