Browse Source

Don't try to copy a null item.

Fixes: lp:1836126
* https://bugs.launchpad.net/kicad/+bug/1836126
pull/15/head
Jeff Young 6 years ago
parent
commit
34894acb89
  1. 11
      eeschema/sch_edit_frame.cpp
  2. 2
      eeschema/tools/sch_line_wire_bus_tool.cpp

11
eeschema/sch_edit_frame.cpp

@ -359,11 +359,14 @@ void SCH_EDIT_FRAME::SaveCopyForRepeatItem( SCH_ITEM* aItem )
// that item may be deleted, such as part of a line concatenation or other.
// So simply always keep a copy of the object which is to be repeated.
delete m_item_to_repeat;
if( aItem )
{
delete m_item_to_repeat;
m_item_to_repeat = (SCH_ITEM*) aItem->Clone();
// Clone() preserves the flags, we want 'em cleared.
m_item_to_repeat->ClearFlags();
m_item_to_repeat = (SCH_ITEM*) aItem->Clone();
// Clone() preserves the flags, we want 'em cleared.
m_item_to_repeat->ClearFlags();
}
}

2
eeschema/tools/sch_line_wire_bus_tool.cpp

@ -797,7 +797,7 @@ void SCH_LINE_WIRE_BUS_TOOL::finishSegments()
}
// Get the last non-null wire (this is the last created segment).
m_frame->SaveCopyForRepeatItem( s_wires.GetLast());
m_frame->SaveCopyForRepeatItem( s_wires.GetLast() );
// Add the new wires
while( s_wires.GetFirst() )

Loading…
Cancel
Save