Skip to content

Commit 03910be

Browse files
committed
perf: add nullptr check when open
1 parent 2815036 commit 03910be

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Seeed_FS.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,10 @@ namespace fs
352352

353353
File FS::open(const char *filepath, uint8_t mode)
354354
{
355+
if(filepath == NULL){
356+
return File();
357+
}
358+
355359
FRESULT ret = FR_OK;
356360
FILINFO v_fileinfo;
357361
FS::_path[0] = _T('0' + _pdrv);

0 commit comments

Comments
 (0)