Skip to content

Commit

Permalink
Fix: Null pointer of table and vector_mgr when the result is null
Browse files Browse the repository at this point in the history
  • Loading branch information
zcdb committed Jun 19, 2023
1 parent 8e17955 commit dfcb620
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions engine/c_api/api_data/gamma_response.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ int Response::Serialize(std::vector<std::string> &fields_name, char **out,
std::map<std::string, int> attr_idx;
Table *table = static_cast<Table *>(table_);
VectorManager *vector_mgr = static_cast<VectorManager *>(vector_mgr_);
// empty result
if (table == nullptr || vector_mgr == nullptr) {
LOG(INFO) << "nullptr: table=" << table << ", vector_mgr=" << vector_mgr;
return 0;
}
const auto &attr_idx_map = table->FieldMap();

if (fields_name.size()) {
Expand Down

0 comments on commit dfcb620

Please sign in to comment.