summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--common/domain/applicationdomaintype.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/common/domain/applicationdomaintype.cpp b/common/domain/applicationdomaintype.cpp
index ee70c35..5cc89b3 100644
--- a/common/domain/applicationdomaintype.cpp
+++ b/common/domain/applicationdomaintype.cpp
@@ -146,7 +146,9 @@ void copyBuffer(Sink::ApplicationDomain::BufferAdaptor &buffer, Sink::Applicatio
146 if (copyBlobs && value.canConvert<BLOB>()) { 146 if (copyBlobs && value.canConvert<BLOB>()) {
147 const auto oldPath = value.value<BLOB>().value; 147 const auto oldPath = value.value<BLOB>().value;
148 const auto newPath = Sink::temporaryFileLocation() + "/" + QUuid::createUuid().toString(); 148 const auto newPath = Sink::temporaryFileLocation() + "/" + QUuid::createUuid().toString();
149 QFile::copy(oldPath, newPath); 149 if (!QFile::copy(oldPath, newPath)) {
150 SinkWarning() << "Failed to copy file from: " << oldPath << "to: " << newPath;
151 }
150 memoryAdaptor.setProperty(property, QVariant::fromValue(BLOB{newPath})); 152 memoryAdaptor.setProperty(property, QVariant::fromValue(BLOB{newPath}));
151 } else if (pruneReferences && value.canConvert<Reference>()) { 153 } else if (pruneReferences && value.canConvert<Reference>()) {
152 continue; 154 continue;
@@ -258,10 +260,12 @@ void ApplicationDomainType::setBlobProperty(const QByteArray &key, const QByteAr
258 const auto path = Sink::temporaryFileLocation() + "/" + QUuid::createUuid().toString(); 260 const auto path = Sink::temporaryFileLocation() + "/" + QUuid::createUuid().toString();
259 QFile file(path); 261 QFile file(path);
260 if (!file.open(QIODevice::WriteOnly)) { 262 if (!file.open(QIODevice::WriteOnly)) {
261 SinkError() << "Failed to open the file for writing: " << file.errorString() << path<< " For property " << key; 263 SinkError() << "Failed to open the file for writing: " << file.errorString() << path << " For property " << key;
262 return; 264 return;
263 } 265 }
264 file.write(value); 266 if (file.write(value) < 0) {
267 SinkError() << "Failed to write to file: " << file.errorString() << path << " For property " << key;
268 }
265 //Ensure that the file is written to disk immediately 269 //Ensure that the file is written to disk immediately
266 file.close(); 270 file.close();
267 setProperty(key, QVariant::fromValue(BLOB{path})); 271 setProperty(key, QVariant::fromValue(BLOB{path}));