From d933b645d8fa6ff51ac4251dcca3f296b79acd46 Mon Sep 17 00:00:00 2001 From: Maschell Date: Mon, 11 Oct 2021 22:43:22 +0200 Subject: [PATCH] Throw an error then reading the disc fails while dumping .app files --- source/ApplicationState.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/source/ApplicationState.cpp b/source/ApplicationState.cpp index a9d202a..83b34c9 100644 --- a/source/ApplicationState.cpp +++ b/source/ApplicationState.cpp @@ -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;