diff options
author | DioEgizio <83089242+DioEgizio@users.noreply.github.com> | 2023-06-14 12:46:00 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-14 12:46:00 +0200 |
commit | a4502f44c291fad2174e84bf883cdb754aa08e28 (patch) | |
tree | 3e879eb534f8727ad29e18c40c151b6a57ec853f /launcher/net | |
parent | 18c436c2bc15358e15209dfbbbc68855e8895f64 (diff) | |
parent | b3d743635c86aac583fb802c1e3c7aa25e12dc88 (diff) | |
download | PrismLauncher-a4502f44c291fad2174e84bf883cdb754aa08e28.tar.gz PrismLauncher-a4502f44c291fad2174e84bf883cdb754aa08e28.tar.bz2 PrismLauncher-a4502f44c291fad2174e84bf883cdb754aa08e28.zip |
Merge pull request #1145 from Trial97/net_job_crash
Diffstat (limited to 'launcher/net')
-rw-r--r-- | launcher/net/ByteArraySink.h | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/launcher/net/ByteArraySink.h b/launcher/net/ByteArraySink.h index 501318a1..728193b3 100644 --- a/launcher/net/ByteArraySink.h +++ b/launcher/net/ByteArraySink.h @@ -53,7 +53,10 @@ class ByteArraySink : public Sink { public: auto init(QNetworkRequest& request) -> Task::State override { - m_output->clear(); + if (m_output) + m_output->clear(); + else + qWarning() << "ByteArraySink did not initialize the buffer because it's not addressable"; if (initAllValidators(request)) return Task::State::Running; return Task::State::Failed; @@ -61,7 +64,10 @@ class ByteArraySink : public Sink { auto write(QByteArray& data) -> Task::State override { - m_output->append(data); + if (m_output) + m_output->append(data); + else + qWarning() << "ByteArraySink did not write the buffer because it's not addressable"; if (writeAllValidators(data)) return Task::State::Running; return Task::State::Failed; @@ -69,7 +75,10 @@ class ByteArraySink : public Sink { auto abort() -> Task::State override { - m_output->clear(); + if (m_output) + m_output->clear(); + else + qWarning() << "ByteArraySink did not clear the buffer because it's not addressable"; failAllValidators(); return Task::State::Failed; } |