Fixes a cache null ref issue in ClearCacheItem (patch by Sir Stéphane Gay)
This commit is contained in:
18
umbraco/cms/businesslogic/cache/Cache.cs
vendored
18
umbraco/cms/businesslogic/cache/Cache.cs
vendored
@@ -31,14 +31,18 @@ namespace umbraco.cms.businesslogic.cache
|
||||
/// <summary>
|
||||
/// Clears the item in umbraco's runtime cache with the given key
|
||||
/// </summary>
|
||||
/// <param name="Key">Key</param>
|
||||
public static void ClearCacheItem(string Key)
|
||||
/// <param name="key">Key</param>
|
||||
public static void ClearCacheItem(string key)
|
||||
{
|
||||
if (System.Web.HttpRuntime.Cache[Key] != null)
|
||||
{
|
||||
HttpRuntime.Cache.Remove(Key);
|
||||
HttpContext.Current.Trace.Warn("Cache", "Item " + Key + " removed from cache");
|
||||
}
|
||||
// NH 10 jan 2012
|
||||
// Patch by the always wonderful Stéphane Gay to avoid cache null refs
|
||||
var cache = HttpRuntime.Cache;
|
||||
if (cache[key] != null)
|
||||
{
|
||||
var context = HttpContext.Current;
|
||||
if (context != null)
|
||||
context.Trace.Warn("Cache", "Item " + key + " removed from cache");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
<ExamineLuceneIndexSets configSource="config\ExamineIndex.config" />
|
||||
<appSettings>
|
||||
<add key="umbracoDbDSN" value="server=.\sqlexpress;database=v47;integrated security=false;user id=DBUSER;password=DBPASSWORD" />
|
||||
<add key="umbracoConfigurationStatus" value="4.7.1.1" />
|
||||
<add key="umbracoConfigurationStatus" value="4.7.1" />
|
||||
<add key="umbracoReservedUrls" value="~/config/splashes/booting.aspx,~/install/default.aspx,~/config/splashes/noNodes.aspx,~/VSEnterpriseHelper.axd" />
|
||||
<add key="umbracoReservedPaths" value="~/umbraco,~/install/" />
|
||||
<add key="umbracoContentXML" value="~/App_Data/umbraco.config" />
|
||||
|
||||
Reference in New Issue
Block a user