Skip to content

Commit

Permalink
Issue 756 fixed the graphd crashed. (vesoft-inc#760)
Browse files Browse the repository at this point in the history
This time only temporarily avoided this crash,
In issue vesoft-inc#192, I will solve this problem for better.
  • Loading branch information
monadbobo authored and dutor committed Aug 13, 2019
1 parent d0fb894 commit 47423d5
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/graph/GoExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -683,6 +683,11 @@ bool GoExecutor::processFinalResult(RpcResponse &rpcResp, Callback cb) const {

for (auto &vdata : resp.vertices) {
std::unique_ptr<RowReader> vreader;
// TODO(simon.liu) In issue #192, I will solve this problem for better.
if (!resp.__isset.vertices || resp.get_vertices() == nullptr) {
continue;
}

if (vschema != nullptr) {
DCHECK(vdata.__isset.vertex_data);
vreader = RowReader::getRowReader(vdata.vertex_data, vschema);
Expand Down Expand Up @@ -781,13 +786,17 @@ OptVariantType GoExecutor::VertexHolder::get(VertexID id, int64_t index) const {
DCHECK(schema_ != nullptr);
auto iter = data_.find(id);

// TODO(dutor) We need a type to represent NULL
CHECK(iter != data_.end());
if (iter == data_.end()) {
return Status::Error("vertex was not found %ld", id);
}

auto reader = RowReader::getRowReader(iter->second, schema_);

auto res = RowReader::getPropByIndex(reader.get(), index);
CHECK(ok(res));
if (!ok(res)) {
return Status::Error("get prop failed");
}

return value(std::move(res));
}

Expand Down

0 comments on commit 47423d5

Please sign in to comment.