catch opening non-existing file for read on OTA

This commit is contained in:
CaCO3
2022-09-25 15:59:29 +02:00
parent 78900defad
commit 4e19066e26
2 changed files with 15 additions and 1 deletions

View File

@@ -99,6 +99,11 @@ static bool ota_update_task(std::string fn)
int data_read;
FILE* f = OpenFileAndWait(fn.c_str(), "rb"); // vorher nur "r"
if (f == NULL) { // File does not exist
return false;
}
data_read = fread(ota_write_data, 1, BUFFSIZE, f);
while (data_read > 0) {