Test for extension before adding to new project

Fixes: lp:1818136
* https://bugs.launchpad.net/kicad/+bug/1818136
This commit is contained in:
Seth Hillbrand 2019-02-28 12:30:02 -08:00
parent 1ba1c6dbf3
commit b9097c2c1d
1 changed files with 2 additions and 1 deletions

View File

@ -232,7 +232,8 @@ void KICAD_MANAGER_FRAME::OnNewProject( wxCommandEvent& aEvent )
// wxFileName automatically extracts an extension. But if it isn't
// a .pro extension, we should keep it as part of the filename
if( pro.GetExt().ToStdString() != ProjectFileExtension )
if( !pro.GetExt().IsEmpty()
&& pro.GetExt().ToStdString() != ProjectFileExtension )
pro.SetName( pro.GetName() + wxT( "." ) + pro.GetExt() );
pro.SetExt( ProjectFileExtension ); // enforce extension