From 9b087f62f93a0b2ef0f00b576dc9f697440c2890 Mon Sep 17 00:00:00 2001 From: Gerhard Hoffmann Date: Sat, 17 Feb 2024 08:04:06 +0100 Subject: [PATCH] Check if json-file to be downloaded to device-controller is empty before starting a download. --- update.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/update.cpp b/update.cpp index 0284b56..6f95e32 100644 --- a/update.cpp +++ b/update.cpp @@ -414,7 +414,7 @@ bool Update::downloadJson(enum FileTypeJson type, QFileInfo fi(jsFileToSendToDC); // max. size of template file is 800 bytes if (file.exists()) { if (file.open(QIODevice::ReadOnly)) { - if (fi.size() <= 800) { + if (fi.size() > 0 && fi.size() <= 800) { QByteArray ba = file.readAll(); // kindOfFile: 1=config, 2=device, 3=cash, 4=serial, 5=time, 6=printer // nrOfTemplate=1...32 if kindOfFile==6