Skip to content

Commit

Permalink
Display "N/A" when SoundFont index doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
dwhinham committed Feb 7, 2021
1 parent 72a06fc commit 5bc0f70
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/mt32pi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,8 @@ void CMT32Pi::DeferSwitchSoundFont(size_t nIndex)
if (m_pSoundFontSynth == nullptr)
return;

LCDLog(TLCDLogType::Notice, "SF %ld: %s", nIndex, m_pSoundFontSynth->GetSoundFontManager().GetSoundFontName(nIndex));
const char* pName = m_pSoundFontSynth->GetSoundFontManager().GetSoundFontName(nIndex);
LCDLog(TLCDLogType::Notice, "SF %ld: %s", nIndex, pName ? pName : "- N/A -");
m_nDeferredSoundFontSwitchIndex = nIndex;
m_nDeferredSoundFontSwitchTime = CTimer::Get()->GetTicks();
m_bDeferredSoundFontSwitchFlag = true;
Expand Down

0 comments on commit 5bc0f70

Please sign in to comment.