Skip to content

Commit

Permalink
Fixed bug with get lists that could cause infinite loop
Browse files Browse the repository at this point in the history
  • Loading branch information
haneytron committed Sep 25, 2014
1 parent 220415c commit e0f8b97
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions Dache.Client/CacheClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -227,12 +227,17 @@ public List<T> Get<T>(IEnumerable<string> cacheKeys)
rawResults = null;
foreach (var routingDictionaryEntry in routingDictionary)
{
if (rawResults == null)
var getResults = routingDictionaryEntry.Key.GetNext().Get(routingDictionaryEntry.Value);
if (getResults != null)
{
rawResults = routingDictionaryEntry.Key.GetNext().Get(routingDictionaryEntry.Value);
continue;
if (rawResults == null)
{
rawResults = getResults;
continue;
}

rawResults.AddRange(getResults);
}
rawResults.AddRange(routingDictionaryEntry.Key.GetNext().Get(routingDictionaryEntry.Value));
}

// If we got here we did all of the work successfully
Expand Down

0 comments on commit e0f8b97

Please sign in to comment.