diff --git a/Hi.UrlRewrite/Caching/RulesCache.cs b/Hi.UrlRewrite/Caching/RulesCache.cs index 42a8bd9..2ed0777 100644 --- a/Hi.UrlRewrite/Caching/RulesCache.cs +++ b/Hi.UrlRewrite/Caching/RulesCache.cs @@ -23,7 +23,14 @@ public RulesCache(Database db) : public List GetInboundRules() { - return (GetObject(inboundRulesKey) as IEnumerable).ToList(); + List returnRules = null; + var rules = GetObject(inboundRulesKey) as IEnumerable; + if (rules != null) + { + returnRules = rules.ToList(); + } + + return returnRules; } public void SetInboundRules(IEnumerable inboundRules) @@ -42,7 +49,14 @@ public void SetInboundRules(IEnumerable inboundRules) public List GetOutboundRules() { - return (GetObject(outboundRulesKey) as IEnumerable).ToList(); + List returnRules = null; + var rules = GetObject(inboundRulesKey) as IEnumerable; + if (rules != null) + { + returnRules = rules.ToList(); + } + + return returnRules; } public void SetOutboundRules(IEnumerable outboundRules) diff --git a/Hi.UrlRewrite/Fields/SiteDropList.cs b/Hi.UrlRewrite/Fields/SiteDropList.cs index 7487b18..17f03c6 100644 --- a/Hi.UrlRewrite/Fields/SiteDropList.cs +++ b/Hi.UrlRewrite/Fields/SiteDropList.cs @@ -82,8 +82,8 @@ protected override bool LoadPostData(string value) return false; } - Sitecore.Diagnostics.Log.Info(this + " : Field : " + GetViewStateString("Field"), this); - Sitecore.Diagnostics.Log.Info(this + " : FieldName : " + GetViewStateString("FieldName"), this); + Sitecore.Diagnostics.Log.Debug(this + " : Field : " + GetViewStateString("Field"), this); + Sitecore.Diagnostics.Log.Debug(this + " : FieldName : " + GetViewStateString("FieldName"), this); if (GetViewStateString("Value") != value) { diff --git a/Hi.UrlRewrite/Hi.UrlRewrite.csproj b/Hi.UrlRewrite/Hi.UrlRewrite.csproj index d99f0c3..9693e24 100644 --- a/Hi.UrlRewrite/Hi.UrlRewrite.csproj +++ b/Hi.UrlRewrite/Hi.UrlRewrite.csproj @@ -125,7 +125,6 @@ - diff --git a/Hi.UrlRewrite/MyFilter.cs b/Hi.UrlRewrite/MyFilter.cs deleted file mode 100644 index ed7c81b..0000000 --- a/Hi.UrlRewrite/MyFilter.cs +++ /dev/null @@ -1,49 +0,0 @@ -using log4net.Filter; -using log4net.spi; -using System; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text.RegularExpressions; -using System.Web; - -namespace Hi.UrlRewrite -{ - public class MyFilter : StringMatchFilter - { - - public override FilterDecision Decide(LoggingEvent loggingEvent) - { - if (loggingEvent == null) - throw new ArgumentNullException("loggingEvent"); - - var exceptionMessage = loggingEvent.GetExceptionStrRep(); - if (string.IsNullOrEmpty(exceptionMessage)) - { - return FilterDecision.NEUTRAL; - } - - if (RegexToMatch != null) - { - var regex = new Regex(RegexToMatch, RegexOptions.Multiline); - - if (!regex.Match(exceptionMessage).Success) - return FilterDecision.NEUTRAL; - - return AcceptOnMatch ? FilterDecision.ACCEPT : FilterDecision.DENY; - } - - if (StringToMatch == null || exceptionMessage.IndexOf(StringToMatch) == -1) - { - return FilterDecision.NEUTRAL; - } - - return AcceptOnMatch ? FilterDecision.ACCEPT : FilterDecision.DENY; - } - - public override void ActivateOptions() - { - base.ActivateOptions(); - } - } -} \ No newline at end of file