From e64b5bfd9fd06ba9d311b87404d5ccb7648f1ea2 Mon Sep 17 00:00:00 2001 From: RKrom Date: Sat, 5 Jan 2013 22:51:53 +0000 Subject: [PATCH] Fixed bug #3599278, which most likely is due to a corrupt/invalid configuration. git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@2408 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4 --- Greenshot/Processors/TitleFixProcessor.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Greenshot/Processors/TitleFixProcessor.cs b/Greenshot/Processors/TitleFixProcessor.cs index beea5f90d..1f2207b70 100644 --- a/Greenshot/Processors/TitleFixProcessor.cs +++ b/Greenshot/Processors/TitleFixProcessor.cs @@ -73,20 +73,21 @@ namespace Greenshot.Processors { public override bool ProcessCapture(ISurface surface, ICaptureDetails captureDetails) { bool changed = false; string title = captureDetails.Title; - LOG.Debug("Title before: " + title); - if (title != null && title.Length > 0) { + if (!string.IsNullOrEmpty(title)) { title = title.Trim(); foreach(string titleIdentifier in config.ActiveTitleFixes) { string regexpString = config.TitleFixMatcher[titleIdentifier]; string replaceString = config.TitleFixReplacer[titleIdentifier]; - if (regexpString != null && regexpString.Length > 0) { + if (replaceString == null) { + replaceString = ""; + } + if (!string.IsNullOrEmpty(regexpString)) { Regex regex = new Regex(regexpString); title = regex.Replace(title, replaceString); changed = true; } } } - LOG.Debug("Title after: " + title); captureDetails.Title = title; return changed; }