7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-07 22:05:32 +00:00

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

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 );