aboutsummaryrefslogtreecommitdiff
path: root/zenserver/cache/structuredcachestore.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'zenserver/cache/structuredcachestore.cpp')
-rw-r--r--zenserver/cache/structuredcachestore.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/zenserver/cache/structuredcachestore.cpp b/zenserver/cache/structuredcachestore.cpp
index d5b892d06..3d7fac13b 100644
--- a/zenserver/cache/structuredcachestore.cpp
+++ b/zenserver/cache/structuredcachestore.cpp
@@ -263,7 +263,15 @@ ZenCacheMemoryLayer::Put(std::string_view InBucket, const IoHash& HashKey, const
RwLock::ExclusiveLockScope _(m_Lock);
- Bucket = &m_Buckets[std::string(InBucket)];
+ auto it = m_Buckets.find(std::string(InBucket));
+ if (it != m_Buckets.end())
+ {
+ Bucket = &it->second;
+ }
+ else
+ {
+ Bucket = &m_Buckets[std::string(InBucket)];
+ }
}
// Note that since the underlying IoBuffer is retained, the content type is also