Skip to content

Commit f87ab54

Browse files
committed
Checking for Area name not null
1 parent 53ea30a commit f87ab54

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

DevTrends.MvcDonutCaching/KeyGenerator.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,10 @@ public string GenerateKey(ControllerContext context, CacheSettings cacheSettings
6060

6161
string areaName = null;
6262

63-
if (routeData.DataTokens.ContainsKey(DataTokensKeyArea))
63+
if (
64+
routeData.DataTokens.ContainsKey(DataTokensKeyArea) &&
65+
routeData.DataTokens[DataTokensKeyArea] != null
66+
)
6467
{
6568
areaName = routeData.DataTokens[DataTokensKeyArea].ToString();
6669
}

0 commit comments

Comments
 (0)