Skip to content

fix(FSCommon): add nRF52 LittleFS empty-name guard to getFiles()#10757

Open
Copilot wants to merge 2 commits into
masterfrom
copilot/fix-review-comment-3448366070
Open

fix(FSCommon): add nRF52 LittleFS empty-name guard to getFiles()#10757
Copilot wants to merge 2 commits into
masterfrom
copilot/fix-review-comment-3448366070

Conversation

Copilot AI commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

getFiles() iterated with while (file) without the file.name()[0] guard that listDir() already uses to work around the Adafruit LittleFS nRF52 glue bug (issue 4395), where openNextFile() can return a File with an empty name. This could cause empty-name entries to be pushed into results and the loop to spin until maxCount was exhausted.

Changes

  • src/FSCommon.cpp — updated the loop condition in getFiles() to match listDir():
// Before
while (file) {

// After
while (file && file.name()[0]) { // file.name()[0] check is a workaround for a bug in the Adafruit LittleFS nrf52 glue (see issue 4395)

🤝 Attestations

  • I have tested that my proposed changes behave as described.
  • I have tested that my proposed changes do not cause any obvious regressions on the following devices:
    • Heltec (Lora32) V3
    • LilyGo T-Deck
    • LilyGo T-Beam
    • RAK WisBlock 4631
    • Seeed Studio T-1000E tracker card
    • Other (please specify below)

Copilot AI changed the title [WIP] Fix code based on review comment 3448366070 fix(FSCommon): add nRF52 LittleFS empty-name guard to getFiles() Jun 21, 2026
Copilot AI requested a review from thebentern June 21, 2026 12:39
@thebentern thebentern marked this pull request as ready for review June 21, 2026 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants