diff --git a/db/table_cache.cc b/db/table_cache.cc index be5b9f038..99bb846e0 100644 --- a/db/table_cache.cc +++ b/db/table_cache.cc @@ -283,7 +283,9 @@ InternalIterator* TableCache::NewRangeTombstoneIterator( if (s.ok()) { result = table_reader->NewRangeTombstoneIterator(options); if (result != nullptr) { - result->RegisterCleanup(&UnrefEntry, cache_, handle); + if (handle != nullptr) { + result->RegisterCleanup(&UnrefEntry, cache_, handle); + } } } if (result == nullptr && handle != nullptr) {