From cd2343e57dbf4ed22796bdde4ffb40060dd7508c Mon Sep 17 00:00:00 2001 From: outfoxxed Date: Sun, 3 Mar 2024 06:27:21 -0800 Subject: [PATCH] fix(stream): segfault for datastream with no reader --- src/io/datastream.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/io/datastream.cpp b/src/io/datastream.cpp index 01a7364..c655921 100644 --- a/src/io/datastream.cpp +++ b/src/io/datastream.cpp @@ -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); }