From 47d88c5647043f1f40197a4fab218ab582f82c8b Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Wed, 18 Jan 2023 00:52:19 +0000 Subject: [PATCH] Nullptr safety. (Sentry KICAD-71) --- eeschema/dialogs/dialog_field_properties.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/eeschema/dialogs/dialog_field_properties.cpp b/eeschema/dialogs/dialog_field_properties.cpp index 8d5a62f768..513e54b20d 100644 --- a/eeschema/dialogs/dialog_field_properties.cpp +++ b/eeschema/dialogs/dialog_field_properties.cpp @@ -227,17 +227,18 @@ void DIALOG_FIELD_PROPERTIES::OnTextValueSelectButtonClick( wxCommandEvent& aEve else fpid = m_TextCtrl->GetValue(); - KIWAY_PLAYER* frame = Kiway().Player( FRAME_FOOTPRINT_VIEWER_MODAL, true ); - - if( frame->ShowModal( &fpid, this ) ) + if( KIWAY_PLAYER* frame = Kiway().Player( FRAME_FOOTPRINT_VIEWER_MODAL, true ) ) { - if( m_StyledTextCtrl->IsShown() ) - m_StyledTextCtrl->SetValue( fpid ); - else - m_TextCtrl->SetValue( fpid ); - } + if( frame->ShowModal( &fpid, this ) ) + { + if( m_StyledTextCtrl->IsShown() ) + m_StyledTextCtrl->SetValue( fpid ); + else + m_TextCtrl->SetValue( fpid ); + } - frame->Destroy(); + frame->Destroy(); + } }