set_wxMenuIcon: prevent null pointer dereference

This commit is contained in:
Maciej Suminski 2018-09-18 11:59:24 +02:00
parent ebb74fcc2b
commit cd5b1c2885
1 changed files with 3 additions and 0 deletions

View File

@ -60,6 +60,9 @@ CONTEXT_MENU::~CONTEXT_MENU()
*/
static void set_wxMenuIcon( wxMenuItem* aMenu, const BITMAP_OPAQUE* aIcon )
{
if( !Pgm().CommonSettings() )
return;
// Retrieve the global applicaton show icon option:
bool useImagesInMenus;
Pgm().CommonSettings()->Read( USE_ICONS_IN_MENUS_KEY, &useImagesInMenus );