Skip to content

Commit

Permalink
add guard if path is null
Browse files Browse the repository at this point in the history
  • Loading branch information
schreibfaul1 committed Feb 9, 2024
1 parent 5f9da1b commit 22bce16
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Audio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -711,6 +711,12 @@ void Audio::UTF8toASCII(char* str) {
// clang-format on
//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
bool Audio::connecttoFS(fs::FS& fs, const char* path, int32_t resumeFilePos) {

if(!path) { // guard
AUDIO_INFO("The given path is empty");
return false;
}

xSemaphoreTakeRecursive(mutex_audio, portMAX_DELAY); // #3

m_resumeFilePos = resumeFilePos;
Expand Down

0 comments on commit 22bce16

Please sign in to comment.