allow pdu segment creators to be called with invalid streams
This commit is contained in:
parent
4440cb6f37
commit
69cb85ef9f
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue