diff options
author | Trial97 <alexandru.tripon97@gmail.com> | 2023-06-15 10:37:10 +0300 |
---|---|---|
committer | Trial97 <alexandru.tripon97@gmail.com> | 2023-06-15 10:37:10 +0300 |
commit | fcfb3d2df786c94ded97778fa241f9c05e73a7cf (patch) | |
tree | 8cc7184f3a011c7e5423bb6740ecfa1f3a643f83 /launcher/net/ByteArraySink.h | |
parent | 8abe6b6732aa18b49199755c89dcedb90ae9c4b6 (diff) | |
parent | 9908e115aa6bdfcceefd1425406d1b6d1c1bdec4 (diff) | |
download | PrismLauncher-fcfb3d2df786c94ded97778fa241f9c05e73a7cf.tar.gz PrismLauncher-fcfb3d2df786c94ded97778fa241f9c05e73a7cf.tar.bz2 PrismLauncher-fcfb3d2df786c94ded97778fa241f9c05e73a7cf.zip |
Merge branch 'develop' of https://github.com/PrismLauncher/PrismLauncher into visit_mod_page
Diffstat (limited to 'launcher/net/ByteArraySink.h')
-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; } |