Fix crash on empty spiffs partition

This commit is contained in:
fvanroie 2020-01-26 19:47:23 +01:00
parent b81345a77e
commit c131ae4a65
2 changed files with 3 additions and 5 deletions

View File

@ -1299,14 +1299,12 @@ void haspLoadPage(String pages)
char msg[92]; char msg[92];
if(!SPIFFS.begin()) { if(!SPIFFS.begin()) {
sprintf_P(msg, PSTR("HASP: \%sFS not mounted. Failed to load %s"), pages.c_str()); errorPrintln(String(F("HASP: %sFS not mounted. Failed to load ")) + pages.c_str());
errorPrintln(msg);
return; return;
} }
if(!SPIFFS.exists(pages)) { if(!SPIFFS.exists(pages)) {
sprintf_P(msg, PSTR("HASP: \%sFile '%s' does not exist"), pages.c_str()); errorPrintln(String(F("HASP: %sNon existing file ")) + pages.c_str());
errorPrintln(msg);
return; return;
} }

View File

@ -39,7 +39,7 @@ void setup()
/* Init Storage */ /* Init Storage */
eepromSetup(); eepromSetup();
#if LV_USE_HASP_SPIFFS #if LV_USE_HASP_SPIFFS
// spiffsSetup(); spiffsSetup();
#endif #endif
/* Read Config File */ /* Read Config File */