Skip to content

Commit

Permalink
error check
Browse files Browse the repository at this point in the history
  • Loading branch information
afender committed Feb 17, 2021
1 parent def166f commit 30e341f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cpp/include/raft/handle.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ class handle_t {
handle_t(const handle_t& other, int stream_id,
int n_streams = kNumDefaultWorkerStreams)
: dev_id_(other.get_device()), streams_(n_streams) {
RAFT_EXPECTS(
other.get_num_internal_streams() > 0,
"ERROR: the main handle must have at least one worker stream\n");
prop_ = other.get_device_properties();
device_prop_initialized_ = true;
device_allocator_ = other.get_device_allocator();
Expand Down

0 comments on commit 30e341f

Please sign in to comment.