Unverified Commit 919f0a79 authored by Xu Qiaolun's avatar Xu Qiaolun Committed by GitHub

Fix Segment fault when creates TitanCompactionFilter (#181) (#194)

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>
Co-authored-by: 's avatardorianzheng <xingzhengde72@gmail.com>
parent 28717a8b
......@@ -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