Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Test" command crash if the stream is stopped (i.e. when mp3client == NULL) #207

Open
Derek-K opened this issue Jul 2, 2021 · 0 comments

Comments

@Derek-K
Copy link

Derek-K commented Jul 2, 2021

Esp-radio/Esp_radio.ino

Lines 2959 to 2963 in 56e57fc

else if ( argument == "test" ) // Test command
{
sprintf ( reply, "Free memory is %d, ringbuf %d, stream %d",
system_get_free_heap_size(), rcount, mp3client->available() ) ;
}

"Test" command will crash if the stream is stopped.

Fix: check if mp3client is Null

  else if ( argument == "test" )                      // Test command
  {
    if (mp3client)
    {
      sprintf ( reply, "Free memory is %d, ringbuf %d, stream %d",
              system_get_free_heap_size(), rcount, mp3client->available() ) ;
    } else {
      sprintf ( reply, "Free memory is %d, ringbuf %d, No stream available",
              system_get_free_heap_size(), rcount ) ;      
    }
  }
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

No branches or pull requests

1 participant