Catch default autowire case

Since we are dereferencing the optional, we need to ensure it exists in
all cases

Fixes https://gitlab.com/kicad/code/kicad/issues/10394
This commit is contained in:
Seth Hillbrand 2022-01-12 09:02:04 -08:00
parent 9a0323fe17
commit 56d87a8613
1 changed files with 4 additions and 0 deletions

View File

@ -419,6 +419,10 @@ int EE_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent )
{ {
newEvt = EE_ACTIONS::drawLines.MakeEvent(); newEvt = EE_ACTIONS::drawLines.MakeEvent();
} }
else
{
newEvt = EE_ACTIONS::drawLines.MakeEvent();
}
auto* params = newEvt->Parameter<DRAW_SEGMENT_EVENT_PARAMS*>(); auto* params = newEvt->Parameter<DRAW_SEGMENT_EVENT_PARAMS*>();
auto* newParams = new DRAW_SEGMENT_EVENT_PARAMS(); auto* newParams = new DRAW_SEGMENT_EVENT_PARAMS();