From ac533e33e5531f7909bdf67e3c9b6236ac465104 Mon Sep 17 00:00:00 2001 From: sr55 Date: Sun, 12 Sep 2010 19:43:27 +0000 Subject: WinGui: - Fix a crash in the Auto-Naming function caused by empty string in the title name. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3523 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- win/C#/Functions/Main.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'win/C#/Functions') diff --git a/win/C#/Functions/Main.cs b/win/C#/Functions/Main.cs index 4fc0496ef..11e6be932 100644 --- a/win/C#/Functions/Main.cs +++ b/win/C#/Functions/Main.cs @@ -808,9 +808,12 @@ namespace Handbrake.Functions StringBuilder sb = new StringBuilder(input.Length); foreach (string s in tokens) { - sb.Append(s[0].ToString().ToUpper()); - sb.Append(s.Substring(1).ToLower()); - sb.Append(" "); + if (!string.IsNullOrEmpty(s)) + { + sb.Append(s[0].ToString().ToUpper()); + sb.Append(s.Substring(1).ToLower()); + sb.Append(" "); + } } return sb.ToString().Trim(); -- cgit v1.2.3