Fix font map cache access creating invalid entries (and crashes)

This commit is contained in:
Marek Roszko 2023-08-26 09:21:12 -04:00
parent 4fefd95e0c
commit 25967b4a0f
1 changed files with 4 additions and 1 deletions

View File

@ -150,7 +150,10 @@ FONT* FONT::GetFont( const wxString& aFontName, bool aBold, bool aItalic )
std::tuple<wxString, bool, bool> key = { aFontName, aBold, aItalic };
FONT* font = s_fontMap[key];
FONT* font = nullptr;
if( s_fontMap.find( key ) != s_fontMap.end() )
font = s_fontMap[key];
if( !font )
font = OUTLINE_FONT::LoadFont( aFontName, aBold, aItalic );