Symbol editor crash: Fix use of a null pointer.

LIB_TEXT::Clone() did not copy a member set to nullptr.
Fixes #11569
https://gitlab.com/kicad/code/kicad/issues/11569
This commit is contained in:
jean-pierre charras 2022-05-06 12:51:26 +02:00
parent dfdedfa605
commit 32077673e8
2 changed files with 4 additions and 1 deletions

View File

@ -73,6 +73,7 @@ EDA_ITEM* LIB_TEXT::Clone() const
{
LIB_TEXT* newitem = new LIB_TEXT( nullptr );
newitem->m_parent = m_parent;
newitem->m_unit = m_unit;
newitem->m_convert = m_convert;
newitem->m_private = m_private;

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2019 CERN
* Copyright (C) 2019-2021 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2019-2022 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -134,6 +134,8 @@ protected:
void saveCopyInUndoList( EDA_ITEM* aItem, UNDO_REDO aType, bool aAppend = false,
bool aDirtyConnectivity = true )
{
wxASSERT( aItem );
KICAD_T itemType = aItem->Type();
bool selected = aItem->IsSelected();