From f1f69c607efdc6d74ebda82b7523e05ee0df7e93 Mon Sep 17 00:00:00 2001 From: Lucas Dumont Date: Thu, 13 Apr 2023 22:53:08 +1200 Subject: [PATCH] Check KiFACE return value Avoid segfault when cancelling initial global library setup (Cherry-picked from 3c24017aa4d5772a11aa7f7fc7c11bc62bda9b1d) --- common/tool/common_control.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/common/tool/common_control.cpp b/common/tool/common_control.cpp index c585764a0f..addf9edd05 100644 --- a/common/tool/common_control.cpp +++ b/common/tool/common_control.cpp @@ -113,7 +113,9 @@ int COMMON_CONTROL::ShowLibraryTable( const TOOL_EVENT& aEvent ) try // Sch frame was not available, try to start it { KIFACE* kiface = m_frame->Kiway().KiFACE( KIWAY::FACE_SCH ); - kiface->CreateKiWindow( m_frame, DIALOG_SCH_LIBRARY_TABLE, &m_frame->Kiway() ); + + if( kiface ) + kiface->CreateKiWindow( m_frame, DIALOG_SCH_LIBRARY_TABLE, &m_frame->Kiway() ); } catch( ... ) {