added error output for passed nullptr cookie

This commit is contained in:
Robin Müller 2020-05-17 17:46:27 +02:00
parent deb8ce3744
commit 80c6eff8a6

View File

@ -37,6 +37,12 @@ DeviceHandlerBase::DeviceHandlerBase(object_id_t setObjectId,
CommandMessage::MAX_MESSAGE_SIZE); CommandMessage::MAX_MESSAGE_SIZE);
cookieInfo.state = COOKIE_UNUSED; cookieInfo.state = COOKIE_UNUSED;
insertInCommandMap(RAW_COMMAND_ID); insertInCommandMap(RAW_COMMAND_ID);
if (comCookie == nullptr) {
sif::error << "DeviceHandlerBase: ObjectID 0x" << std::hex <<
this->getObjectId() << std::dec << ": Do not pass nullptr as a"
" cookie, consider passing a dummy cookie instead!" <<
std::endl;
}
if (this->fdirInstance == nullptr) { if (this->fdirInstance == nullptr) {
this->fdirInstance = new DeviceHandlerFailureIsolation(setObjectId, this->fdirInstance = new DeviceHandlerFailureIsolation(setObjectId,
defaultFDIRParentId); defaultFDIRParentId);