From ad34095bfaeb9c8c42c45d983a78f0eddce2ef3b Mon Sep 17 00:00:00 2001 From: Karai Csaba Date: Sun, 1 May 2016 12:19:11 +0200 Subject: [PATCH] Fix issue with invalid user file system --- web-server/web-server.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/web-server/web-server.c b/web-server/web-server.c index b7df35e..0d83eb5 100644 --- a/web-server/web-server.c +++ b/web-server/web-server.c @@ -15,9 +15,10 @@ void ICACHE_FLASH_ATTR webServerBrowseFiles() char buffer[1024]; buffer[0] = 0; - EspFsIterator it; - espFsIteratorInit(userPageCtx, &it); + if( espFsIsValid( userPageCtx ) ) { + EspFsIterator it; + espFsIteratorInit(userPageCtx, &it); while( espFsIteratorNext(&it) ) { int nlen = strlen(it.name); @@ -65,11 +66,10 @@ void ICACHE_FLASH_ATTR webServerBrowseFiles() void ICACHE_FLASH_ATTR webServerInit() { espFsInit(userPageCtx, (void *)getUserPageSectionStart(), ESPFS_FLASH); - if( espFsIsValid( userPageCtx ) ) { + if( espFsIsValid( userPageCtx ) ) os_printf("Valid user file system found!\n"); - webServerBrowseFiles(); - } else os_printf("No user file system found!\n"); + webServerBrowseFiles(); }