From 620aa315f64ef8aafd4c81c5133c05321b1a42db Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Wed, 21 Apr 2021 15:21:34 +0100 Subject: [PATCH] Show infobar error when asking for empty datasheet. Fixes https://gitlab.com/kicad/code/kicad/issues/8260 --- eeschema/tools/ee_inspection_tool.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/eeschema/tools/ee_inspection_tool.cpp b/eeschema/tools/ee_inspection_tool.cpp index 917011fdaf..94ac501191 100644 --- a/eeschema/tools/ee_inspection_tool.cpp +++ b/eeschema/tools/ee_inspection_tool.cpp @@ -492,7 +492,9 @@ int EE_INSPECTION_TOOL::ShowDatasheet( const TOOL_EVENT& aEvent ) datasheet = component->GetField( DATASHEET_FIELD )->GetText(); } - if( !datasheet.IsEmpty() && datasheet != wxT( "~" ) ) + if( datasheet.IsEmpty() || datasheet == wxT( "~" ) ) + m_frame->ShowInfoBarError( _( "No datasheet defined." ) ); + else GetAssociatedDocument( m_frame, datasheet, &m_frame->Prj() ); return 0;