fix(stream): segfault for datastream with no reader

This commit is contained in:
outfoxxed 2024-03-03 06:27:21 -08:00
parent bccf43f1f7
commit cd2343e57d
Signed by untrusted user: outfoxxed
GPG key ID: 4C88A185FB89301E

View file

@ -35,6 +35,7 @@ void DataStream::onReaderDestroyed() {
}
void DataStream::onBytesAvailable() {
if (this->mReader == nullptr) return;
auto buf = this->ioDevice()->readAll();
this->mReader->parseBytes(buf, this->buffer);
}