cwIoMidiRecordPlay.cpp : am_to_midi_file() verify file exists.

This commit is contained in:
kevin 2022-10-01 19:00:33 -04:00
parent c0ab1ba53f
commit 5b3b6ab3cb

View File

@ -1333,6 +1333,12 @@ cw::rc_t cw::midi_record_play::am_to_midi_file( const char* am_filename, const c
unsigned msgArrayCnt = 0;
am_midi_msg_t* msgArray = nullptr;
if(!filesys::isFile(am_filename))
{
cwLogError(kOpenFailRC,"The AM file '%s' does not exist.",am_filename);
goto errLabel;
}
if((rc = _am_file_read( am_filename, msgArrayCnt, msgArray )) != kOkRC )
{
rc = cwLogError(rc,"Unable to read AM file '%s'.", cwStringNullGuard(am_filename));