mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-15 09:31:45 +00:00
Zmq: let GetData of an empty message return nullptr
This commit is contained in:
@@ -155,9 +155,17 @@ class Message final : public fair::mq::Message
|
||||
void* GetData() const override
|
||||
{
|
||||
if (!fViewMsg) {
|
||||
return zmq_msg_data(fMsg.get());
|
||||
if (zmq_msg_size(fMsg.get()) > 0) {
|
||||
return zmq_msg_data(fMsg.get());
|
||||
} else {
|
||||
return nullptr;
|
||||
}
|
||||
} else {
|
||||
return zmq_msg_data(fViewMsg.get());
|
||||
if (zmq_msg_size(fViewMsg.get()) > 0) {
|
||||
return zmq_msg_data(fViewMsg.get());
|
||||
} else {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user