Gerbview: fix a crash when clicking on a gbr item not on active layer.
This commit is contained in:
parent
5065961cf5
commit
2ff1403212
|
@ -52,7 +52,7 @@ GERBER_DRAW_ITEM* GERBVIEW_FRAME::Locate( const wxPoint& aPosition, int aTypeloc
|
|||
GERBER_FILE_IMAGE* gerber = g_GERBER_List.GetGbrImage( layer );
|
||||
|
||||
// Search first on active layer
|
||||
GERBER_DRAW_ITEM* gerb_item;
|
||||
GERBER_DRAW_ITEM* gerb_item = NULL;
|
||||
|
||||
if( gerber ) // A not used graphic layer can be selected. So gerber can be NULL
|
||||
{
|
||||
|
@ -83,10 +83,13 @@ GERBER_DRAW_ITEM* GERBVIEW_FRAME::Locate( const wxPoint& aPosition, int aTypeloc
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if( found )
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if( found )
|
||||
if( found && gerb_item )
|
||||
{
|
||||
MSG_PANEL_ITEMS items;
|
||||
gerb_item->GetMsgPanelInfo( items );
|
||||
|
|
Loading…
Reference in New Issue