Test for extension before adding to new project
Fixes: lp:1818136 * https://bugs.launchpad.net/kicad/+bug/1818136
This commit is contained in:
parent
1ba1c6dbf3
commit
b9097c2c1d
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue