From 9a254643379ba0cbac8b36e3a3cc8f7b1c1ca0fa Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Mon, 28 Nov 2022 13:38:26 +0000 Subject: [PATCH] Prevent nullptr dereference. Fixes https://gitlab.com/kicad/code/kicad/issues/12516 --- eeschema/sch_edit_frame.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/eeschema/sch_edit_frame.cpp b/eeschema/sch_edit_frame.cpp index 97ce323f13..36bb651bea 100644 --- a/eeschema/sch_edit_frame.cpp +++ b/eeschema/sch_edit_frame.cpp @@ -708,7 +708,10 @@ void SCH_EDIT_FRAME::HardRedraw() item->ClearCaches(); for( std::pair& libSymbol : screen->GetLibSymbols() ) - libSymbol.second->ClearCaches(); + { + if( libSymbol.second ) + libSymbol.second->ClearCaches(); + } RecalculateConnections( LOCAL_CLEANUP );