Unverified Commit 1e16e4ca authored by peizhou001's avatar peizhou001 Committed by GitHub
Browse files

[Graphbolt]Throw exception when id not found (#6128)

parent b328b85f
...@@ -160,6 +160,9 @@ inline IdType ConcurrentIdHashMap<IdType>::MapId(IdType id) const { ...@@ -160,6 +160,9 @@ inline IdType ConcurrentIdHashMap<IdType>::MapId(IdType id) const {
Next(&pos, &delta); Next(&pos, &delta);
key = hash_map_data[getKeyIndex(pos)]; key = hash_map_data[getKeyIndex(pos)];
} }
if (key == empty_key) {
throw std::out_of_range("Id not found: " + std::to_string(id));
}
return hash_map_data[getValueIndex(pos)]; return hash_map_data[getValueIndex(pos)];
} }
......
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