aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--host/lib/transport/nirio/rpc/rpc_client.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/host/lib/transport/nirio/rpc/rpc_client.cpp b/host/lib/transport/nirio/rpc/rpc_client.cpp
index c16a844c1..32a40a576 100644
--- a/host/lib/transport/nirio/rpc/rpc_client.cpp
+++ b/host/lib/transport/nirio/rpc/rpc_client.cpp
@@ -133,9 +133,12 @@ const boost::system::error_code& rpc_client::call(
CHAIN_BLOCKING_XFER(
boost::asio::write(_socket, boost::asio::buffer(&_request.header, sizeof(_request.header))),
sizeof(_request.header), status);
- CHAIN_BLOCKING_XFER(
- boost::asio::write(_socket, boost::asio::buffer(&(*_request.data.begin()), _request.data.size())),
- _request.data.size(), status);
+ if (not _request.data.empty())
+ {
+ CHAIN_BLOCKING_XFER(
+ boost::asio::write(_socket, boost::asio::buffer(&(*_request.data.begin()), _request.data.size())),
+ _request.data.size(), status);
+ }
} catch (boost::exception&) {
status = false;
}