From 655cee523b145f0aa1fba565972af16943e1259f Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Sat, 2 Mar 2024 15:23:23 +0100 Subject: [PATCH] Eeschema: fix crash when editing a old legacy schematic with missing libs, and trying to edit a dummy symbol. (crash due to a null pointer due to missing lib) From master branch Fixes #17232 https://gitlab.com/kicad/code/kicad/-/issues/17232 --- eeschema/fields_grid_table.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/eeschema/fields_grid_table.cpp b/eeschema/fields_grid_table.cpp index e9736e41dc..d0b22b5855 100644 --- a/eeschema/fields_grid_table.cpp +++ b/eeschema/fields_grid_table.cpp @@ -1,7 +1,7 @@ /* * This program source code file is part of KiCad, a free EDA CAD application. * - * Copyright (C) 2018-2023 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2018-2024 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 @@ -455,8 +455,9 @@ wxGridCellAttr* FIELDS_GRID_TABLE::GetAttr( int aRow, int aCol, wxGridCellAtt else if( m_parentType == SCH_SYMBOL_T && aRow == FOOTPRINT_FIELD ) { // Power symbols have do not appear in the board, so don't allow - // a footprint - if( m_part->IsPower() ) + // a footprint (m_part can be nullptr when loading a old schematic + // (for instance Kicad 4) with libraries missing) + if( m_part && m_part->IsPower() ) { m_readOnlyAttr->IncRef(); return m_readOnlyAttr;