1
0
Fork 0

allow pdu segment creators to be called with invalid streams

This commit is contained in:
Kevin Matz 2021-08-16 10:44:25 -04:00
parent 4440cb6f37
commit 69cb85ef9f
1 changed files with 4 additions and 3 deletions

View File

@ -155,7 +155,7 @@ public:
if (flags_.hasHeader)
{
header_ = new T();
if (stream_->good())
if (stream_ && stream_->good())
header_->iStream(stream_);
}
}
@ -165,14 +165,15 @@ public:
if (flags_.hasData)
{
data_ = new T();
if (stream_->good())
if (stream_ && stream_->good())
data_->iStream(stream_);
}
}
template<class T>
void createDataBlock() {
auto block = new PDU::Block<T>();
block->iStream(stream_);
if (stream_)
block->iStream(stream_);
block->setParent(shared_from_this());
data_ = block;
}