diff --git a/cache/clock_cache.cc b/cache/clock_cache.cc index 8c26f7a9c..f57859830 100644 --- a/cache/clock_cache.cc +++ b/cache/clock_cache.cc @@ -367,7 +367,9 @@ ClockCacheShard::~ClockCacheShard() { for (auto& handle : list_) { uint32_t flags = handle.flags.load(std::memory_order_relaxed); if (InCache(flags) || CountRefs(flags) > 0) { - (*handle.deleter)(handle.key, handle.value); + if (handle.deleter != nullptr) { + (*handle.deleter)(handle.key, handle.value); + } delete[] handle.key.data(); } }