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

(cherry picked from commit 56d87a8613)
This commit is contained in:
Seth Hillbrand 2022-01-12 09:02:04 -08:00
parent cf11abda3d
commit 5a3d53d9e4
1 changed files with 4 additions and 0 deletions

View File

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