diff --git a/libraries/Adafruit_LittleFS/src/Adafruit_LittleFS_File.cpp b/libraries/Adafruit_LittleFS/src/Adafruit_LittleFS_File.cpp index 3091f477e..43ed2d962 100644 --- a/libraries/Adafruit_LittleFS/src/Adafruit_LittleFS_File.cpp +++ b/libraries/Adafruit_LittleFS/src/Adafruit_LittleFS_File.cpp @@ -68,6 +68,7 @@ bool File::_open_file (char const *filepath, uint8_t mode) PRINT_LFS_ERR(rc); // free memory rtos_free(_file); + _file = NULL; return false; } @@ -93,6 +94,7 @@ bool File::_open_dir (char const *filepath) PRINT_LFS_ERR(rc); // free memory rtos_free(_dir); + _dir = NULL; return false; }