From 30e341f483003a1094e326c49780c9382846d867 Mon Sep 17 00:00:00 2001 From: afender Date: Wed, 17 Feb 2021 17:56:56 -0600 Subject: [PATCH] error check --- cpp/include/raft/handle.hpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cpp/include/raft/handle.hpp b/cpp/include/raft/handle.hpp index 42a1e4ebb8..dbe7e83189 100644 --- a/cpp/include/raft/handle.hpp +++ b/cpp/include/raft/handle.hpp @@ -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();