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
1 changed files with 1 additions and 0 deletions

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);
}