Throw an error then reading the disc fails while dumping .app files

This commit is contained in:
Maschell 2021-10-11 22:43:22 +02:00
parent 189f20b662
commit d933b645d8
1 changed files with 7 additions and 1 deletions

View File

@ -811,7 +811,13 @@ void ApplicationState::dumpAppFiles() {
if (toRead > bufferSize) {
toRead = bufferSize;
}
dataProvider->readRawContent(content, readBuffer, curOffset, toRead);
if(!dataProvider->readRawContent(content, readBuffer, curOffset, toRead)){
DEBUG_FUNCTION_LINE("Failed to read content");
this->setError(ERROR_WRITE_FAILED);
forceExit = true;
break;
}
if (file.write((const uint8_t *) readBuffer, toRead) != (int32_t) toRead) {
DEBUG_FUNCTION_LINE("Failed to write");
break;