Unverified Commit 9df8f051 authored by dorianzheng's avatar dorianzheng Committed by GitHub

Fix Segment fault when creates TitanCompactionFilter (#181)

Looks like it's not a undefined behavior to get a nullptr from compaction filter factory

Fixes #180 
Signed-off-by: 's avatarDorianZheng <xingzhengde72@gmail.com>
parent 6abf3dcb
......@@ -157,6 +157,11 @@ class TitanCompactionFilterFactory final : public CompactionFilterFactory {
original_filter_factory_->CreateCompactionFilter(context);
original_filter = original_filter_from_factory.get();
}
if (original_filter == nullptr) {
return nullptr;
}
return std::unique_ptr<CompactionFilter>(new TitanCompactionFilter(
titan_db_impl_, cf_name_, original_filter,
std::move(original_filter_from_factory), blob_storage, skip_value_));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment