Make sure we don't upload empty images

This commit is contained in:
ArsenArsen 2017-06-13 17:02:35 +02:00
parent f04aa81b9f
commit 40d9edd7a8
2 changed files with 2 additions and 1 deletions

View File

@ -31,7 +31,7 @@ RecordingFormats::RecordingFormats(formats::Recording f) {
delete enc; delete enc;
if (interrupt) { if (interrupt) {
tmpDir.removeRecursively(); tmpDir.removeRecursively();
return; return QByteArray();
} }
QFile res(path); QFile res(path);
if (!res.open(QFile::ReadOnly)) { if (!res.open(QFile::ReadOnly)) {

View File

@ -73,6 +73,7 @@ void UploaderSingleton::upload(QPixmap *pixmap) {
} }
void UploaderSingleton::upload(QByteArray img, QString format) { void UploaderSingleton::upload(QByteArray img, QString format) {
if (img.isEmpty()) return;
QFile file(saveDir.absoluteFilePath(formatter::format(settings::settings().value("fileFormat").toString(), format.toLower()))); QFile file(saveDir.absoluteFilePath(formatter::format(settings::settings().value("fileFormat").toString(), format.toLower())));
if (file.open(QFile::WriteOnly)) { if (file.open(QFile::WriteOnly)) {
file.write(img); file.write(img);